Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
]
}
},
"postCreateCommand": "cd INCHI-1-TEST && ./install.sh"
"postCreateCommand": "cd INCHI-1-TEST && ./install_build_dependencies.sh && ./install_test_dependencies.sh"
}
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INCHI-1-TEST/tests/test_library/config/
INCHI-1-TEST/tests/test_library/data/
INCHI-1-TEST/libs/
INCHI-1-TEST/exes/
**/__pycache__/
**/__pycache__/
CMake_build/
INCHI-1-SRC/INCHI_API/libinchi/src/build/
13 changes: 0 additions & 13 deletions .github/actions/compile_inchi_exe/action.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/actions/compile_inchi_lib/action.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/actions/invariance_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Show gcc version
run: |
gcc --version
shell: bash

- name: Show ldd version
run: |
ldd --version || true
shell: bash

- name: Run invariance tests
run: run-tests --test-config=INCHI-1-TEST/tests/test_library/config/config.invariance.py --data-config=INCHI-1-TEST/tests/test_library/config/config.ci.py
shell: bash
Expand Down
10 changes: 0 additions & 10 deletions .github/actions/regression_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Show gcc version
run: |
gcc --version
shell: bash

- name: Show ldd version
run: |
ldd --version || true
shell: bash

- name: Run regression tests
run: run-tests --test-config=INCHI-1-TEST/tests/test_library/config/config.regression.py --data-config=INCHI-1-TEST/tests/test_library/config/config.ci.py
shell: bash
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,33 @@ jobs:
- uses: actions/checkout@v4

- name: Install test dependencies
run: cd INCHI-1-TEST && ./install.sh
run: cd INCHI-1-TEST && ./install_test_dependencies.sh

- uses: ./.github/actions/compile_inchi_exe
id: compile_exe
- name: Install build dependencies
run: cd INCHI-1-TEST && ./install_build_dependencies.sh

- id: build_exe
run: ./INCHI-1-TEST/build_with_cmake.sh exe

- name: Run executable tests
if: ${{ !cancelled() && steps.compile_exe.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_exe.outcome == 'success' }}
run: pytest INCHI-1-TEST/tests/test_executable

- uses: ./.github/actions/compile_inchi_lib
id: compile_lib
- id: build_lib
run: ./INCHI-1-TEST/build_with_cmake.sh lib

- name: Run multithreading test
if: ${{ !cancelled() && steps.compile_lib.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_lib.outcome == 'success' }}
run: python INCHI-1-TEST/tests/test_library/test_multithreading.py
timeout-minutes: 1

- uses: ./.github/actions/regression_tests
if: ${{ !cancelled() && steps.compile_lib.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_lib.outcome == 'success' }}
with:
artifact-name: regression-test-results_glibc_gcc

- uses: ./.github/actions/invariance_tests
if: ${{ !cancelled() && steps.compile_lib.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_lib.outcome == 'success' }}
with:
artifact-name: invariance-test-results_glibc_gcc

Expand All @@ -51,7 +54,7 @@ jobs:
steps:
- name: Install build and test environment
run: |
apk add bash git musl-dev gcc g++ make python3 py-pip
apk add bash git musl-dev gcc g++ make python3 py-pip cmake

# We need to install git before checking out the repository.
# Otherwise, the repository will be downloaded using the GitHub REST API instead of git.
Expand All @@ -74,23 +77,23 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -e INCHI-1-TEST

- uses: ./.github/actions/compile_inchi_exe
id: compile_exe
- id: build_exe
run: ./INCHI-1-TEST/build_with_cmake.sh exe

- name: Run executable tests
if: ${{ !cancelled() && steps.compile_exe.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_exe.outcome == 'success' }}
run: pytest INCHI-1-TEST/tests/test_executable

- uses: ./.github/actions/compile_inchi_lib
id: compile_lib
- id: build_lib
run: ./INCHI-1-TEST/build_with_cmake.sh lib

- name: Run multithreading test
if: ${{ !cancelled() && steps.compile_lib.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_lib.outcome == 'success' }}
run: python INCHI-1-TEST/tests/test_library/test_multithreading.py
timeout-minutes: 1

- uses: ./.github/actions/regression_tests
if: ${{ !cancelled() && steps.compile_lib.outcome == 'success' }}
if: ${{ !cancelled() && steps.build_lib.outcome == 'success' }}
with:
artifact-name: regression-test-results_musl_gcc

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
INCHI-1-TEST/exes
INCHI-1-TEST/libs
INCHI-1-TEST/tests/test_library/data/**/*.html
INCHI-1-TEST/tests/test_library/data/**/*.log
INCHI-1-TEST/tests/test_library/data/pubchem/**
Expand All @@ -16,3 +14,5 @@ __pycache__
*.egg-info/
# Ignore core dump files
core.*[0-9]
CMake_build/
INCHI-1-SRC/INCHI_API/libinchi/src/build/
Binary file added INCHI-1-DOC/assets/cmake_tool1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added INCHI-1-DOC/assets/cmake_tool2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions INCHI-1-SRC/INCHI_API/demos/inchi_main/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

project(InChIMain_API VERSION 1.7)

add_library(inchimain_compiler_flags INTERFACE)
target_compile_features(inchimain_compiler_flags INTERFACE c_std_11)

set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:C,ARMClang,AppleClang,Clang,GNU,LCC>")
set(msvc_cxx "$<COMPILE_LANG_AND_ID:C,MSVC>")
target_compile_options(inchimain_compiler_flags INTERFACE
"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-g;-O1;-c;-fno-strict-aliasing;-Wno-all>>"
"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3;-MT;-O2>>"
)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/static")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")

set(P_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../INCHI_BASE/src")
set(P_LIBINCHI "${CMAKE_CURRENT_SOURCE_DIR}/../../../libinchi/src")
set(P_LIBINCHI_BUILD "${CMAKE_CURRENT_SOURCE_DIR}/../../../libinchi/src/build")
set(P_CURRENT "${CMAKE_CURRENT_SOURCE_DIR}")
set(P_VC "${CMAKE_CURRENT_SOURCE_DIR}/../vc14")

include_directories(${P_CURRENT})

add_subdirectory(${P_LIBINCHI} ${P_LIBINCHI_BUILD})

add_executable(inchi_main)

target_sources(inchi_main PRIVATE
aux2atom.h
e_0dstereo.c
e_0dstereo.h
e_comdef.h
e_ctl_data.h
e_ichi_io.c
e_ichi_io.h
e_ichi_parms.c
e_ichicomp.h
e_ichierr.h
e_ichimain.c
e_ichimain_a.c
e_ichisize.h
e_ichitime.h
e_inchi_atom.c
e_inchi_atom.h
e_inpdef.h
e_main.h
e_mode.h
e_mol_frmt.h
e_mol2atom.c
e_readinch.c
e_readmol.c
e_readmol.h
e_readstru.c
e_readstru.h
e_util.c
e_util.h
${P_BASE}/bcf_s.h
${P_BASE}/bcf_s.c
${P_BASE}/logging.h
${P_VC}/resource.h
)

target_link_libraries(inchi_main PUBLIC libinchi)

set(CMAKE_DEBUG_POSTFIX d)
set_target_properties(inchi_main PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})

target_link_libraries(inchi_main PUBLIC inchimain_compiler_flags)

find_library(MATH_LIBRARY m)
if(MATH_LIBRARY)
target_link_libraries(inchi_main PUBLIC ${MATH_LIBRARY})
endif()

target_compile_definitions(inchi_main PRIVATE
BUILD_LINK_AS_DLL
TARGET_EXE_USING_API
)

target_include_directories(inchi_main PUBLIC "${PROJECT_BINARY_DIR}")

string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")

if(WIN32)
add_custom_command(TARGET inchi_main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:inchi_main> $<TARGET_RUNTIME_DLLS:inchi_main>
COMMAND_EXPAND_LISTS
)
else()
add_custom_command(TARGET inchi_main POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libinchi> $<TARGET_FILE_DIR:inchi_main>
COMMAND_EXPAND_LISTS
)
endif()
74 changes: 74 additions & 0 deletions INCHI-1-SRC/INCHI_API/demos/mol2inchi/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)

project(Mol2InChI_API VERSION 1.7)

add_library(mol2inchi_compiler_flags INTERFACE)
target_compile_features(mol2inchi_compiler_flags INTERFACE c_std_11)

set(gcc_like_cxx "$<COMPILE_LANG_AND_ID:C,ARMClang,AppleClang,Clang,GNU,LCC>")
set(msvc_cxx "$<COMPILE_LANG_AND_ID:C,MSVC>")
target_compile_options(mol2inchi_compiler_flags INTERFACE
"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-g;-O1;-c;-fno-strict-aliasing;-Wno-all>>"
"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3;-MT;-O2>>"
)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib/static")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")

set(P_BASE "${CMAKE_CURRENT_SOURCE_DIR}/../../../../INCHI_BASE/src")
set(P_LIBINCHI "${CMAKE_CURRENT_SOURCE_DIR}/../../../libinchi/src")
set(P_LIBINCHI_BUILD "${CMAKE_CURRENT_SOURCE_DIR}/../../../libinchi/src/build")
set(P_CURRENT "${CMAKE_CURRENT_SOURCE_DIR}")
set(P_VC "${CMAKE_CURRENT_SOURCE_DIR}/../vc14")

include_directories(${P_CURRENT})

add_subdirectory(${P_LIBINCHI} ${P_LIBINCHI_BUILD})

add_executable(mol2inchi)

target_sources(mol2inchi PRIVATE
mol2inchi.c
mol2inchi.h
moreutil.c
moreutil.h
${P_BASE}/bcf_s.h
${P_BASE}/bcf_s.c
${P_BASE}/logging.h
${P_VC}/resource.h
)

target_link_libraries(mol2inchi PUBLIC libinchi)

set(CMAKE_DEBUG_POSTFIX d)
set_target_properties(mol2inchi PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})

target_link_libraries(mol2inchi PUBLIC mol2inchi_compiler_flags)

find_library(MATH_LIBRARY m)
if(MATH_LIBRARY)
target_link_libraries(mol2inchi PUBLIC ${MATH_LIBRARY})
endif()

target_compile_definitions(mol2inchi PRIVATE
BUILD_LINK_AS_DLL
TARGET_EXE_USING_API
)

target_include_directories(mol2inchi PUBLIC "${PROJECT_BINARY_DIR}")

string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")

if(WIN32)
add_custom_command(TARGET mol2inchi POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:mol2inchi> $<TARGET_RUNTIME_DLLS:mol2inchi>
COMMAND_EXPAND_LISTS
)
else()
add_custom_command(TARGET mol2inchi POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libinchi> $<TARGET_FILE_DIR:mol2inchi>
COMMAND_EXPAND_LISTS
)
endif()
Loading