Skip to content

Commit

Permalink
fix cmaes_found
Browse files Browse the repository at this point in the history
  • Loading branch information
phbasler committed Jul 16, 2024
1 parent 035d3ce commit 1f79267
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(UseNLopt)

endif(UseNLopt)

if(NOT libcmaes_FOUND AND NOT NLopt_FOUND)
if(NOT cmaes_FOUND AND NOT NLopt_FOUND)
message(FATAL_ERROR "You need at least libcmaes or NLopt.")
endif()

Expand Down Expand Up @@ -179,7 +179,7 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
Spline
ASCIIPlotter
BSMPT_Config)
if(libcmaes_FOUND)
if(cmaes_FOUND)
list(APPEND ExportList Minimizer_CMAES)
endif()
if(NLopt_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion include/BSMPT/config.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#cmakedefine libcmaes_FOUND
#cmakedefine cmaes_FOUND
#cmakedefine NLopt_FOUND
#cmakedefine Boost_FOUND
#cmakedefine nlohmann_json_FOUND
2 changes: 1 addition & 1 deletion include/BSMPT/minimizer/Minimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const bool UseGSLDefault = true;
/**
* @brief UseLibCMAESDefault Use the Libcmaes minimizer in the default settings
*/
#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
const bool UseLibCMAESDefault = true;
#else
const bool UseLibCMAESDefault = false;
Expand Down
2 changes: 1 addition & 1 deletion src/minimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_sources(
PUBLIC MinimizeGSL.cpp Minimizer.cpp MinimizePlane.cpp
PUBLIC ${header})

if(libcmaes_FOUND)
if(cmaes_FOUND)
add_subdirectory(LibCMAES)
target_link_libraries(Minimizer PUBLIC Minimizer_CMAES)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/minimizer/LibCMAES/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target_link_libraries(Minimizer_CMAES INTERFACE Minimizer)

# target_link_libraries(Minimizer_CMAES INTERFACE libcmaes::cmaes)
target_link_libraries(Minimizer_CMAES
INTERFACE "$<LINK_LIBRARY:WHOLE_ARCHIVE,libcmaes::cmaes>")
INTERFACE libcmaes::cmaes)
if(OpenMP_FOUND)
target_link_libraries(Minimizer_CMAES INTERFACE OpenMP::OpenMP_CXX)
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/minimizer/MinimizePlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <BSMPT/config.h>

#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
#include <BSMPT/minimizer/LibCMAES/MinimizeLibCMAES.h>
#endif

Expand Down Expand Up @@ -172,7 +172,7 @@ MinimizePlane(const std::vector<double> &basepoint,
Minima.push_back(GSLResult.Minimum);
}

#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
if (UseMinimizer.UseCMAES and modelPointer->get_nVEV() >= 3)
{
std::vector<double> startCMAES(params.nVEV - 1);
Expand Down
8 changes: 4 additions & 4 deletions src/minimizer/Minimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <exception>

#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
#include <BSMPT/minimizer/LibCMAES/MinimizeLibCMAES.h>
#endif

Expand Down Expand Up @@ -69,7 +69,7 @@ MinimizersToUse GetMinimizers(int WhichMinimizer)
WhichMinimizer /= 2;
bool UseNLopt = (WhichMinimizer % 2 != 0);

#ifndef libcmaes_FOUND
#ifndef cmaes_FOUND
UseCMAES = false;
#endif

Expand Down Expand Up @@ -153,7 +153,7 @@ Minimize_gen_all(const std::shared_ptr<Class_Potential_Origin> &modelPointer,
}
}
}
#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
std::thread thread_CMAES;
LibCMAES::LibCMAESReturn LibCMAES;
if (UseMinimizer.UseCMAES)
Expand Down Expand Up @@ -210,7 +210,7 @@ Minimize_gen_all(const std::shared_ptr<Class_Potential_Origin> &modelPointer,
}
#endif

#ifdef libcmaes_FOUND
#ifdef cmaes_FOUND
if (UseMultithreading and thread_CMAES.joinable())
{
Logger::Write(LoggingLevel::MinimizerDetailed, "Waiting for CMAES Thread");
Expand Down
4 changes: 2 additions & 2 deletions tools/cmake/BSMPTConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ find_dependency(GSL @GSL_VERSION@)
find_dependency(OpenMP @OpenMP_CXX_VERSION@)
find_dependency(Threads @Threads_VERSION@)

if(@libcmaes_FOUND@ AND NOT @EXPORT_CMAES@)
if(@cmaes_FOUND@ AND NOT @EXPORT_CMAES@)
find_dependency(libcmaes)
endif(@libcmaes_FOUND@ AND NOT @EXPORT_CMAES@)
endif(@cmaes_FOUND@ AND NOT @EXPORT_CMAES@)

if(@NLopt_FOUND@)
find_dependency(NLopt @NLopt_VERSION@)
Expand Down

0 comments on commit 1f79267

Please sign in to comment.