Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt : remove -O2 from OPENHRP_DEFINITIONS #1177

Merged
merged 1 commit into from
Jul 5, 2017

Conversation

k-okada
Copy link
Contributor

@k-okada k-okada commented Jul 4, 2017

https://stackoverflow.com/questions/5557261/gcc-multiple-optimization-flags

If you use multiple -O options, with or without level numbers, the last such option is the one that is effective.

Before

[hrpsys:make] Building CXX object rtc/CollisionDetector/CMakeFiles/CollisionDetectorComp.dir/CollisionDetectorComp.o
[hrpsys:make] cd /home/k-okada/catkin_ws/ws_hrpsys_fcn/build/hrpsys/rtc/CollisionDetector && /usr/bin/c++   -DQHULL -DROBOT_IOB_VERSION=2
 -DUSE_FCL -DUSE_HRPSYSUTIL -O3 -DNDEBUG -I/home/k-okada/catkin_ws/ws_hrpsys_fcn/build/hrpsys -I/opt/ros/indigo/include
 -I/opt/ros/indigo/include/coil-1.1 -I/opt/ros/indigo/include/openrtm-1.1 -I/opt/ros/indigo/include/openrtm-1.1/rtm/idl -I/opt/ros/indigo/include/OpenHRP-3.1
 -I/usr/include/eigen3 -I/usr/include/opencv -I/usr/include/libxml2 -I/home/k-okada/catkin_ws/ws_hrpsys_fcn/src/hrpsys-base/rtc/SequencePlayer
 -I/home/k-okada/catkin_ws/ws_hrpsys_fcn/src/hrpsys-base/rtc/CollisionDetector/vclip_1.0/include    -DNDEBUG -O2 -I/opt/ros/indigo/include
 -I/opt/ros/indigo/include/coil-1.1 -I/opt/ros/indigo/include/openrtm-1.1 -I/opt/ros/indigo/include/openrtm-1.1/rtm/idl -I/opt/ros/indigo/include/OpenHRP-3.1
 -I/usr/include/eigen3 -DHRPSYS_PACKAGE_VERSION="\"315.13.0\"" -o CMakeFiles/CollisionDetectorComp.dir/CollisionDetectorComp.o
 -c /home/k-okada/catkin_ws/ws_hrpsys_fcn/src/hrpsys-base/rtc/CollisionDetector/CollisionDetectorComp.cpp

After

[hrpsys:make] Building CXX object rtc/SequencePlayer/CMakeFiles/SequencePlayerComp.dir/__/ImpedanceController/JointPathEx.cpp.o
[hrpsys:make] cd /home/k-okada/catkin_ws/ws_hrpsys_fcn/build/hrpsys/rtc/SequencePlayer && /usr/bin/c++   -DROBOT_IOB_VERSION=2 -O3
 -DNDEBUG -I/home/k-okada/catkin_ws/ws_hrpsys_fcn/build/hrpsys -I/opt/ros/indigo/include -I/opt/ros/indigo/include/coil-1.1
 -I/opt/ros/indigo/include/openrtm-1.1 -I/opt/ros/indigo/include/openrtm-1.1/rtm/idl -I/opt/ros/indigo/include/OpenHRP-3.1 -I/usr/include/eigen3
 -I/usr/include/opencv    -DNDEBUG -I/opt/ros/indigo/include -I/opt/ros/indigo/include/coil-1.1 -I/opt/ros/indigo/include/openrtm-1.1
 -I/opt/ros/indigo/include/openrtm-1.1/rtm/idl -I/opt/ros/indigo/include/OpenHRP-3.1 -I/usr/include/eigen3 -DHRPSYS_PACKAGE_VERSION="\"315.13.0\""
 -o CMakeFiles/SequencePlayerComp.dir/__/ImpedanceController/JointPathEx.cpp.o -c /home/k-okada/catkin_ws/ws_hrpsys_fcn/src/hrpsys-base/rtc/ImpedanceController/JointPathEx.cpp

@k-okada
Copy link
Contributor Author

k-okada commented Jul 4, 2017

@fkanehiro OPENHRP_DEFNITIONSに '-O2' が入っているのですが、なにか理由があるでしょうか?これでCMKE_BUILD_TYPE=Releaseとしても-O2になっている気がします.

@fkanehiro
Copy link
Owner

OpenHRPはOpenRTMのcflagsを継承していて、OpenRTMのcflagsにO2が入っている、ということではないでしょうか。
http://redmine.openrtm.org/issues/3714

@k-okada
Copy link
Contributor Author

k-okada commented Jul 4, 2017 via email

@k-okada
Copy link
Contributor Author

k-okada commented Jul 5, 2017

@fkanehiro テストとおりました.どうでしょうか.

@fkanehiro fkanehiro merged commit 45e64a8 into fkanehiro:master Jul 5, 2017
@fkanehiro
Copy link
Owner

マージしてしまいましたが、OPENHRP_DEFINITIONSが空の環境では、REGEXの引数が足りない、といってエラーになるようです。

@fkanehiro
Copy link
Owner

更に今更なんですが、元々OPENHRP_DEFINITIONSはOPENHRP_CXX_FLAGSから-Dxxを抜き出したものなので、-O2は入っていないのでは。

@k-okada
Copy link
Contributor Author

k-okada commented Jul 5, 2017 via email

@k-okada k-okada deleted the remove_o2 branch July 5, 2017 02:56
@k-okada
Copy link
Contributor Author

k-okada commented Jul 5, 2017

こっちの環境だけかもしれないんですが、
https://s3.amazonaws.com/archive.travis-ci.org/jobs/250160415/log.txt?X-Amz-Expires=29&X-Amz-Date=20170705T025711Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJRYRXRSVGNKPKO5A/20170705/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=d47ed5ec2a07daca978ee67d3d45302a0c781d42d396d56680d6e2319149bb53https://s3.amazonaws.com/archive.travis-ci.org/jobs/250160415/log.txt?X-Amz-Expires=29&X-Amz-Date=20170705T025711Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJRYRXRSVGNKPKO5A/20170705/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=d47ed5ec2a07daca978ee67d3d45302a0c781d42d396d56680d6e2319149bb53
とはいるんですよね....

-- OPENHRP_DEFINITIONS: -DNDEBUG -O2 -I/opt/ros/hydro/include -I/opt/ros/hydro/include/coil-1.1 -I/opt/ros/hydro/include/openrtm-1.1 -I/opt/ros/hydro/include/openrtm-1.1/rtm/idl -I/opt/ros/hydro/include/OpenHRP-3.1 -I/usr/include/eigen3
-- REMOVE -Ox option from OPENHRP_DEFINITIONS, use CMAKE_BUILD_TYPE
-- OPENHRP_DEFINITIONS: -DNDEBUG -I/opt/ros/hydro/include -I/opt/ros/hydro/include/coil-1.1 -I/opt/ros/hydro/include/openrtm-1.1 -I/opt/ros/hydro/include/openrtm-1.1/rtm/idl -I/opt/ros/hydro/include/OpenHRP-3.1 -I/usr/include/eigen3

@fkanehiro
Copy link
Owner

正規表現の読み方がよくわからないのですが、-DNDEBUGから始まっていることによって、まるごとOPENHRP_DEFINITIONSに入っている、ということはないでしょうか。

@k-okada
Copy link
Contributor Author

k-okada commented Jul 5, 2017

はい
-DNDEBUG -O2 -I/opt/ros/hydro/include -I/opt/ros/hydro/include/coil-1.1 -I/opt/ros/hydro/include/openrtm-1.1 -I/opt/ros/hydro/include/openrtm-1.1/rtm/idl -I/opt/ros/hydro/include/OpenHRP-3.1 -I/usr/include/eigen3
がOPENHRP_DEFINITIONSにはいっています

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants