bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
114 stars 24 forks source link

Fix Windows -- MinGW build #116

Closed amontoison closed 1 year ago

amontoison commented 1 year ago

Ok, all tests passed on Windows -- MinGW here, so the issue is maybe in my compilation script for Yggdrasil :thinking: My compilation script is:

cd "${WORKSPACE}/srcdir/nomad"
mkdir "${WORKSPACE}/path"
export PATH="${WORKSPACE}/path:$PATH}"
export WADF=${WORKSPACE}/srcdir/nomad/src/Attribute/WriteAttributeDefinitionFile.cpp
${CXX_FOR_BUILD} ${WADF} -o ${WORKSPACE}/path/WriteAttributeDefinitionFile

sed s/'set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR} CACHE PATH "..." FORCE)'// -i CMakeLists.txt

mkdir build
cd build

cmake -DBUILD_INTERFACE_C=ON \
    -DTEST_OPENMP=OFF \
    -DCMAKE_INSTALL_PREFIX=${prefix} \
    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
    -DCMAKE_BUILD_TYPE=Release ..
make -j${nproc}
make install
ctribes commented 1 year ago

I think the sed is not necessary anymore:

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR} CACHE PATH "..." FORCE) endif()

But it should be ok anyway.

ctribes commented 1 year ago

Just a comment on the modifs for the new version.

For windows, libraries have the same file name as before (libnomadAlgos.dll,...) but for linux and OSX, the libraries have the version number in their name (libnomadAlgo.4.3.0.so,...) and symbolic links are put in the lib directory.

ctribes commented 1 year ago

The modif is in another pull request.