Commit 56d71faa authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Make jrl-walkgen compiles on clang (mac catalina)

parent ce69c523
......@@ -31,16 +31,16 @@ PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
ADD_PROJECT_DEPENDENCY(LAPACK REQUIRED)
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED PKG_CONFIG_REQUIRES pinocchio)
IF(BUILD_TESTING)
IF(FULL_BUILD_TESTING)
ADD_PROJECT_DEPENDENCY("talos_data" REQUIRED)
ENDIF(BUILD_TESTING)
ENDIF(FULL_BUILD_TESTING)
# Handle OS specificities
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE("sys/time.h" SYS_TIME_H)
#IF(SYS_TIME_H)
ADD_DEFINITIONS("-DHAVE_SYS_TIME_H")
#ENDIF(SYS_TIME_H)
IF(SYS_TIME_H)
ADD_DEFINITIONS("-DHAVE_SYS_TIME_H")
ENDIF(SYS_TIME_H)
# TODO kinda dirty patch to find lssol for now
# using ADD_OPTIONAL_DEPENDENCY prevents the creation
......@@ -51,7 +51,7 @@ IF(USE_LSSOL)
ENDIF(USE_LSSOL)
IF(USE_QUADPROG)
ADD_REQUIRED_DEPENDENCY("eigen-quadprog >= 1.0.0")
ADD_PROJECT_DEPENDENCY(eigen-quadprog REQUIRED)
ENDIF(USE_QUADPROG)
# Add aggressive optimization flags in release mode.
......@@ -153,15 +153,17 @@ IF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDIF(SUFFIX_SO_VERSION)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "-msse -msse2 -msse3 -march=core2 -mfpmath=sse -fivopts -ftree-loop-im -fipa-pta ")
IF (UNIX AND NOT APPLE)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "-msse -msse2 -msse3 -march=core2 -mfpmath=sse -fivopts -ftree-loop-im -fipa-pta ")
ENDIF(UNIX AND NOT APPLE)
IF(USE_LSSOL)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} lssol)
ENDIF(USE_LSSOL)
IF(USE_QUADPROG)
PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} eigen-quadprog)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} eigen-quadprog::eigen-quadprog)
ENDIF(USE_QUADPROG)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
......
......@@ -168,7 +168,9 @@ PatternGeneratorInterfacePrivate::PatternGeneratorInterfacePrivate(
}
void PatternGeneratorInterfacePrivate::AllowFPE() {
#ifndef __APPLE_CC__
feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
#endif
}
void PatternGeneratorInterfacePrivate::RegisterPluginMethods() {
......
......@@ -47,7 +47,7 @@ void DumpReferencesObjects::setAnklePositions(
m_AnklePositionLeft = AnklePositionLeft;
}
void DumpReferencesObjects::prepareFile(ofstream &aof, string &prefix,
struct OneStep &anOneStep) {
OneStep &anOneStep) {
string aFileName;
aFileName = prefix;
aFileName += ".dat";
......@@ -88,7 +88,7 @@ void DumpReferencesObjects::fillFileWithSubsamplingAndClose(
}
void DumpReferencesObjects::fillInTests(
std::string &aTestName, struct OneStep &anOneStep,
std::string &aTestName, OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration) {
if (m_InternalFormat == 0)
fillInTestsFormat1(aTestName, anOneStep, aCurrentConfiguration);
......@@ -97,7 +97,7 @@ void DumpReferencesObjects::fillInTests(
}
void DumpReferencesObjects::fillInTestsFormat1(
std::string &aTestName, struct OneStep &anOneStep,
std::string &aTestName, OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration)
{
......@@ -273,7 +273,7 @@ void DumpReferencesObjects::fillInTestsFormat1(
}
void DumpReferencesObjects::fillInTestsFormat2(
std::string &aTestName, struct OneStep &anOneStep,
std::string &aTestName, OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration)
{
......
......@@ -14,10 +14,10 @@ public:
std::ofstream &aof;
double dt;
double nb_subsampling;
struct OneStep &anOneStep;
OneStep &anOneStep;
FillingFileArgs_t(std::ofstream &laof, double ldt, double lnb_subsampling,
struct OneStep &lOneStep)
OneStep &lOneStep)
: aof(laof), dt(ldt), nb_subsampling(lnb_subsampling),
anOneStep(lOneStep){};
};
......@@ -30,23 +30,23 @@ public:
void setAnklePositions(Eigen::Vector3d &AnklePositionRight,
Eigen::Vector3d &AnklePositionLeft);
virtual void prepareFile(std::ofstream &aof, std::string &prefix,
struct OneStep &anOneStep);
OneStep &anOneStep);
/// Fill-in tests
/// \param[in] aTestName: Prefix of the test (typically algorithm name)
/// \param[in] anOneStep: One iteration of the algorithm
/// \param[in] aCurrentConfiguration: A configuration vector in
/// RPY + motor angle format.
/// This method is a front end for fillInTestFormat1 and fillInTestFormat2
virtual void fillInTests(std::string &aTestName, struct OneStep &anOneStep,
virtual void fillInTests(std::string &aTestName, OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration);
///
virtual void fillInTestsFormat1(std::string &aTestName,
struct OneStep &anOneStep,
OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration);
virtual void fillInTestsFormat2(std::string &aTestName,
struct OneStep &anOneStep,
OneStep &anOneStep,
Eigen::VectorXd &aCurrentConfiguration);
virtual void
......
......@@ -56,7 +56,9 @@ namespace TestSuite {
TestObject::TestObject(int argc, char *argv[], string &aTestName,
int lPGIInterface) {
// Generates a signal when a NaN occurs.
#ifndef __APPLE_CC__
feenableexcept(FE_INVALID | FE_OVERFLOW);
#endif
m_TestName = aTestName;
m_OneStep.m_TestName = m_TestName;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment