AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
108 stars 31 forks source link

model name "model" leads to cmake failures #2546

Open FFroehlich opened 2 days ago

FFroehlich commented 2 days ago

model name "model" is default for pysb, leads to clash in cmake target names (see error below). Not sure whether we should not permit models named "model" or add a prefix to the cmake target.

python-BaseException
running build_ext
running AmiciBuildCMakeExtension
------------------------------ model_ext ------------------------------

==> Configuring:
$ cmake -S .../amici_models/0.26.3/model -B .../amici_models/0.26.3/model/build_model_ext -G Ninja -DCMAKE_MAKE_PROGRAM=.../.venv/bin/ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.../amici_models/0.26.3/model/model -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_MODULE_PATH=.../.venv/lib/python3.12/site-packages/amici/lib/cmake/SuiteSparse;.../.venv/lib/python3.12/site-packages/amici/lib64/cmake/SuiteSparse -DKLU_ROOT=.../.venv/lib/python3.12/site-packages/amici -DAMICI_PYTHON_BUILD_EXT_ONLY=ON -DPython3_EXECUTABLE=.../.venv/bin/python

==> Building:
$ cmake --build .../amici_models/0.26.3/model/build_model_ext --config Release

==> Installing:
$ cmake --install .../amici_models/0.26.3/model/build_model_ext --config Release

-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CUR_FLAG_SUPPORTED
-- Performing Test CUR_FLAG_SUPPORTED - Success
-- Performing Test CUR_FLAG_SUPPORTED
-- Performing Test CUR_FLAG_SUPPORTED - Success
-- Performing Test CUR_FLAG_SUPPORTED
-- Performing Test CUR_FLAG_SUPPORTED - Success
-- Found OpenMP_C: -Xclang -fopenmp (found version "5.1")
-- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.1")
-- Found OpenMP: TRUE (found version "5.1")
-- SuiteSparse_config version: 7.8.2
-- SuiteSparse_config include: .../.venv/lib/python3.12/site-packages/amici/include/suitesparse
-- SuiteSparse_config library: .../.venv/lib/python3.12/site-packages/amici/lib/libsuitesparseconfig.a
-- SuiteSparse_config static:  .../.venv/lib/python3.12/site-packages/amici/lib/libsuitesparseconfig.a
-- AMD version: 3.3.3
-- AMD include: .../.venv/lib/python3.12/site-packages/amici/include/suitesparse
-- AMD library: .../.venv/lib/python3.12/site-packages/amici/lib/libamd.a
-- AMD static:  .../.venv/lib/python3.12/site-packages/amici/lib/libamd.a
-- BTF version: 2.3.2
-- BTF include: .../.venv/lib/python3.12/site-packages/amici/include/suitesparse
-- BTF library: .../.venv/lib/python3.12/site-packages/amici/lib/libbtf.a
-- BTF static:  .../.venv/lib/python3.12/site-packages/amici/lib/libbtf.a
-- COLAMD version: 3.3.4
-- COLAMD include: .../.venv/lib/python3.12/site-packages/amici/include/suitesparse
-- COLAMD library: .../.venv/lib/python3.12/site-packages/amici/lib/libcolamd.a
-- COLAMD static:  .../.venv/lib/python3.12/site-packages/amici/lib/libcolamd.a
-- KLU version: 2.3.4
-- KLU include: .../.venv/lib/python3.12/site-packages/amici/include/suitesparse
-- KLU library: .../.venv/lib/python3.12/site-packages/amici/lib/libklu.a
-- KLU static:  .../.venv/lib/python3.12/site-packages/amici/lib/libklu.a
-- Trying FindBLAS with BLA_VENDOR=Apple
-- Looking for dgemm_
-- Looking for dgemm_ - found
-- Found BLAS: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Accelerate.framework
-- Found Apple Accelerate BLAS
-- Found HDF5: hdf5-shared;hdf5_cpp-shared (found version "1.14.3") found components: C HL CXX
-- Found AMICI .../.venv/lib/python3.12/site-packages/amici/lib/cmake/Amici
CMake Error at CMakeLists.txt:103 (add_library):
  add_library cannot create ALIAS target "model" because another target with
  the same name already exists.

-- Found SWIG: /opt/homebrew/bin/swig (found version "4.2.1")
-- Found Python3: .../.venv/bin/python (found version "3.12.6") found components: Interpreter Development Development.Module Development.Embed
-- Python extension suffix is .cpython-312-darwin.so
-- Configuring incomplete, errors occurred!
dweindl commented 2 days ago

The problem here is just creating the ALIAS target model. If the actual model is already called model, we can just skip that step. I can fix that.