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

Test the C interface #100

Closed amontoison closed 2 years ago

amontoison commented 2 years ago

ExampleAdvancedBatchFixedVariables fails for all platforms.

ctribes commented 2 years ago

There is a relative link to nomad executable in the script (runScript.sh) that manages the test ExampleAdvancedBatchFixedVariable.

I suggest to replace the content of $NOMAD_HOME/examples/advanced/batch/FixedVariable/CMakeLists.txt by

`set(CMAKE_EXECUTABLE_SUFFIX .exe) add_executable(uu.exe uu.cpp ) set_target_properties(uu.exe PROPERTIES SUFFIX "")

installing executables and libraries

install(TARGETS uu.exe RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} )

Add a test for this example

if(BUILD_TESTS MATCHES ON)

if (WIN32)
    #add_test(NAME ExampleAdvancedBatchFixedVariables
    #COMMAND 
    # WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
else()
    message(STATUS "    Add example batch fixed variables") 

    add_test(NAME ExampleAdvancedBatchFixedVariables
    COMMAND bash -c "pwd; rm -f cache.txt ; ${CMAKE_INSTALL_PREFIX}/bin/nomad param1.txt ; ${CMAKE_INSTALL_PREFIX}/bin/nomad param2.txt ; ${CMAKE_INSTALL_PREFIX}/bin/nomad param3.txt ; ${CMAKE_INSTALL_PREFIX}/bin/nomad param10.txt"
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
endif()

endif() `

amontoison commented 2 years ago

Thanks @ctribes! All tests passed now.