#3056 closed defect (fixed)
Mac openmodelica-devel fails to build
Reported by: | Owned by: | Adrian Pop | |
---|---|---|---|
Priority: | high | Milestone: | 1.9.4 |
Component: | Build Environment | Version: | trunk |
Keywords: | Cc: | Martin Sjölund |
Description
I just attempted an upgrade to openmodelica 23917, on my Mac, and it fails. From the log, it appears to relate to modelica3d. I do have that variant selected, and it was building fine that way.
the end of the log is below:
:info:build [ 50%] Building CXX object lib/proc3d/CMakeFiles/proc3d.dir/src/proc3d.cpp.o :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/lib/proc3d/src/proc3d.cpp:22: :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/lib/proc3d/src/proc3d.hpp:26: :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/lib/proc3d/src/operations.hpp:26: :info:build In file included from /opt/local/include/boost/numeric/ublas/matrix.hpp:18: :info:build In file included from /opt/local/include/boost/numeric/ublas/vector.hpp:21: :info:build In file included from /opt/local/include/boost/numeric/ublas/storage.hpp:25: :info:build In file included from /opt/local/include/boost/numeric/ublas/exception.hpp:19: :info:build In file included from /opt/local/include/boost/numeric/ublas/detail/config.hpp:299: :info:build /opt/local/include/boost/numeric/ublas/fwd.hpp:21:10: fatal error: 'array' file not found :info:build #include <array> :info:build ^ :info:build 1 error generated. :info:build make[5]: *** [lib/proc3d/CMakeFiles/proc3d.dir/src/proc3d.cpp.o] Error 1 :info:build make[5]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/build' :info:build make[4]: *** [lib/proc3d/CMakeFiles/proc3d.dir/all] Error 2 :info:build make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/build' :info:build make[3]: *** [all] Error 2 :info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917/3rdParty/modelica3d/build' :info:build make[2]: *** [modelica3d] Error 2 :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917' :info:build make[1]: *** [omc-bootstrapped] Error 2 :info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917' :info:build make: *** [all] Error 2 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917' :info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_23917" && /usr/bin/make -j4 -w all NOLIBRARIES=Yes :info:build Exit code: 2 :error:build org.macports.build for port openmodelica-devel returned: command execution failed :debug:build Error code: CHILDSTATUS 90537 2 :debug:build Backtrace: command execution failed
and I will also attach the full log.
Attachments (5)
Change History (59)
by , 10 years ago
comment:1 by , 10 years ago
comment:2 by , 10 years ago
I also filed a ticket with macports.
https://trac.macports.org/ticket/46418
I think that this problem likely relates to the update of macports boost to 1.57.
comment:3 by , 10 years ago
I saw that tickets https://trac.openmodelica.org/OpenModelica/ticket/2978 and https://trac.openmodelica.org/OpenModelica/ticket/3209 were fixed, and I was hoping to be able to test them. But, due to this bug, I still can't get modelica3d to compile on my Mac.
There were some discussions about this with Macports folks, as shown in the ticket I filed above, but no conclusion was reached.
comment:4 by , 10 years ago
It seems like a trivial issue to fix. Unfortunately I have no Mac to play with this and even if I would I don't know how things are working on it.
As far as I can understand from the macports ticket, you could try to add:
-DBOOST_ROOT=/opt/local/include/boost/
in the Makefile.in line 155:
cd 3rdParty/modelica3d/build && $(CMAKE_RPATH) -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DOSG_BACKEND=1 -DUSE_OMC=0 -DBOOST_ROOT=/opt/local/include/boost/ ..
comment:5 by , 10 years ago
Cc: | added |
---|---|
Component: | Unknown → Build Environment |
Owner: | changed from | to
comment:6 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:7 by , 10 years ago
It looks like macports cleans up when it is done installing. So after installing I don't see Makefile.in And, if I just start to build, and stop it part way through, I see many different files with that name in the working directories.
Can you suggest which one might be the correct Makefile.in?
comment:9 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Yes, that did the job. It now builds.
thank you.
comment:10 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
No, I missed a flag, when I thought I had gotten it to build.
It still fails at:
:info:build [ 50%] Building CXX object lib/proc3d/CMakeFiles/proc3d.dir/src/proc3d.cpp.o :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25020/3rdParty/modelica3d/lib/proc3d/src/proc3d.cpp:22: :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25020/3rdParty/modelica3d/lib/proc3d/src/proc3d.hpp:26: :info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25020/3rdParty/modelica3d/lib/proc3d/src/operations.hpp:26: :info:build In file included from /opt/local/include/boost/numeric/ublas/matrix.hpp:18: :info:build In file included from /opt/local/include/boost/numeric/ublas/vector.hpp:21: :info:build In file included from /opt/local/include/boost/numeric/ublas/storage.hpp:25: :info:build In file included from /opt/local/include/boost/numeric/ublas/exception.hpp:19: :info:build In file included from /opt/local/include/boost/numeric/ublas/detail/config.hpp:299: :info:build /opt/local/include/boost/numeric/ublas/fwd.hpp:21:10: fatal error: 'array' file not found :info:build #include <array> :info:build ^ :info:build 1 error generated. :info:build make[5]: *** [lib/proc3d/CMakeFiles/proc3d.dir/src/proc3d.cpp.o] Error 1 :info:build make[5]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25020/3rdParty/modelica3d/build' :info:build make[4]: *** [lib/proc3d/CMakeFiles/proc3d.dir/all] Error 2
comment:13 by , 10 years ago
We need to see the full log with CMAKE_VERBOSE_MAKEFILE=ON, otherwise we'll be blind.
Try this:
> export CMAKE_VERBOSE_MAKEFILE=ON > do the openmodelica build, into a trace file and attach the trace here > trace.txt 2>&1
comment:14 by , 10 years ago
OK. I'm trying it now. Normally, the build process is done within macports, and I don't think that the export gets passed in to the build process.
So, I let macports setup the files, then I went into the working folder it created and there I am doing: make > trace.txt 2>&1
I think that should give the same results, and I will post that file, as soon as it completes.
comment:15 by , 10 years ago
You will need to export CMAKE_VERBOSE_MAKEFILE=ON before running make as the modelica3d stuff is build by CMake and usually it doesn't show the commands used to compile the stuff if you don't have that variable set.
comment:16 by , 10 years ago
I switched to the macports created working folder. I then switched to root (the issue is that macports builds things with a different ownership then the typical user). I then did:
export CMAKE_VERBOSE_MAKEFILE=ON make -j6 > trace.txt 2>&1
And, I have attached that file. Does it show what you need?
comment:17 by , 10 years ago
Unfortunately it doesn't. I hate CMake as it suppresses everything and you can never see what it does.
However, have a look into folder:
/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25032/3rdParty/modelica3d/build
for a file called CMakeCache.txt and post it here.
by , 10 years ago
Attachment: | CMakeCache.txt added |
---|
comment:18 by , 10 years ago
Thanks. This seems to be correct:
Boost_INCLUDE_DIR:PATH=/opt/local/include
Now i need the file: includes_CXX.rsp from directory:
/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_25032/3rdParty/modelica3d/build/lib/proc3d/CMakeFiles/proc3d.dir/
comment:19 by , 10 years ago
That file doesn't exist. Here is what I find in the directory you asked about:
CXX.includecache build.make depend.internal flags.make progress.make DependInfo.cmake cmake_clean.cmake depend.make link.txt src
by , 10 years ago
Attachment: | proc3d.dir.zip added |
---|
/3rdParty/modelica3d/build/lib/proc3d/CMakeFiles/proc3d.dir
comment:22 by , 10 years ago
It seems that the include flags are correct inside flags.make:
-I/opt/local/include -I/opt/local/include/boost
Which supports both #include <boost/xxx> and #include <xxx>
directly (the change I made last night).
Then I find it very strange that it doesn't work:
/opt/local/include/boost/numeric/ublas/fwd.hpp:21:10: fatal error: 'array' file not found #include <array> ^ 1 error generated.
Do you have a file array.hpp here: /opt/local/include/boost/array.hpp?
comment:23 by , 10 years ago
Yup, it is there:
$ ls /opt/local/include/boost/array.hpp /opt/local/include/boost/array.hpp
That is very strange!
comment:24 by , 10 years ago
#include <array> does not include array.hpp. It requests a file called array.
comment:25 by , 10 years ago
I just did a search for a file name "array" in /opt/local/include/boost. What I find are two directories:
/opt/local/include/boost/fusion/adapted/array /opt/local/include/boost/preprocessor/array
And one file:
/opt/local/include/boost/tr1/tr1/array
Does that help at all?
follow-up: 33 comment:26 by , 10 years ago
Ok, it seems there is a file in boost\tr1\tr1\array (in Windows and I've seen from your MacOS ticket that is the same for Mac) so it means we need to include /tr1/tr1 also? What the heck?
I'll change the CMakeLists.txt to add that too.
comment:28 by , 10 years ago
I'll try it as soon as it syncs up and is available. And, will let you know.
I did also post on the Macports site, to see if they have any explanation. It seems very strange that it used to work fine, but then broke with an update to boost a few months ago.
comment:30 by , 10 years ago
Seems so (broken boost) as it works fine in Windows, Linux, on the Moon, on Mars and everywhere in the universe except MacOS :)
comment:31 by , 10 years ago
Well, after I added the include it started to break on Linux. I'll see what I can do to make it only for Mac.
comment:33 by , 10 years ago
Replying to adrpo:
Ok, it seems there is a file in boost\tr1\tr1\array (in Windows and I've seen from your MacOS ticket that is the same for Mac) so it means we need to include /tr1/tr1 also? What the heck?
I'll change the CMakeLists.txt to add that too.
array is also a new header added in C++11, for the fixed-size array class. Whether C++11 is enabled by default or not depends on which compiler is used. So #include <array> is probably not a good idea if the purpose is to include the boost header.
comment:34 by , 10 years ago
Thanks Per, Martin suggested it too and I fixed it now in r25043 by adding -std=c++11 for MacOS.
More about it here:
http://stackoverflow.com/questions/12516830/mac-osx-10-7-4-xcode-4-4-1-no-array-header-file
comment:35 by , 10 years ago
So, it seems that boost on Mac was not broken just our flags. Hopefully it will work now with r25043. We might actually need to add also -stdlib=libc++ but we'll see the report from Adam first.
follow-up: 37 comment:36 by , 10 years ago
It's crazy if boost starts requiring C++11 though :)
No ifdef to disable things requiring it?
comment:37 by , 10 years ago
Replying to sjoelund.se:
It's crazy if boost starts requiring C++11 though :)
No ifdef to disable things requiring it?
My version of boost (1.57.0) says:
#ifdef BOOST_UBLAS_CPP_GE_2011 #include <array> #endif
where BOOST_UBLAS_CPP_GE_2011 is only defined if C++11 is used. So it shouldn't require C++11.
comment:41 by , 10 years ago
Well....that changed the error, but doesn't allow it to build. It now gives std related errors. The log is attached.
comment:42 by , 10 years ago
Looks like we might need to add -std=c++11 -stdlib=libc++ to the linker flags also.
comment:43 by , 10 years ago
I will try to get access to a Mac as just playing with the flags forever is not a good way.
comment:44 by , 10 years ago
It should work now with r25049. I tested on our Mac.
I'm trying now to see if the viewer and dbus stuff works or not.
comment:45 by , 10 years ago
The dbus-server.py works for me like this:
In one terminal:
# start the dbus server > sudo launchctl load -w /opt/openmodelica/Library/LaunchDaemons/org.freedesktop.dbus-system.plist > launchctl load -w /opt/openmodelica/Library/LaunchAgents/org.freedesktop.dbus-session.plist # export python path >export PYTHONPATH=/opt/openmodelica/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$PYTHONPATH # run the dbus-server.py > python dbus-server.py
In another terminal:
> cat > modelica3d.mos loadModelica3D();getErrorString(); loadString("model DoublePendulum extends Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum; inner ModelicaServices.Modelica3D.Controller m3d_control; end DoublePendulum;");getErrorString(); instantiateModel(DoublePendulum); getErrorString(); simulate(DoublePendulum); getErrorString(); CTRL+D > omc modelica3d.mos
Unfortunately I have no idea if it works as my X forwarding to my Windows XMing server doesn't seem to work correctly.
follow-up: 47 comment:46 by , 10 years ago
Don't install X-dependent libraries on OSX. At least I hope you didn't update the installer to pick X libs because that would make the users unhappy, needing to install X servers as well :)
comment:47 by , 10 years ago
Replying to sjoelund.se:
Don't install X-dependent libraries on OSX. At least I hope you didn't update the installer to pick X libs because that would make the users unhappy, needing to install X servers as well :)
As I have no idea what you're talking about I guess all is fine :)
comment:48 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Yes, it works!
A couple of minor issues in the user guide change (and instructions above).
1) I believe that the dbus instructions just have to be done once after installing dbus. Those enable launchctl to run dbus in the future.
2) The export PYTHONPATH doesn't seem to be necessary (at least, it runs fine on my machine without that.) But, I am not sure about how all python search paths are set....
3) It looks like you installed macports in a non-standard directory. There is no problem in doing that, but you should clarify that in the directions, or users who are unfamiliar will not be able to get it to work.
So, on my machine (which uses the default macports install), each place you have "/opt/openmodelica/" in the directions, I have to substitute "/opt/local/"
Again, thanks much for the all the effort to get this fixed.
comment:49 by , 10 years ago
/opt/openmodelica is on purpose, so people can use a local macports and the OpenModelica installer on the side
comment:50 by , 10 years ago
I understand.
I just thought that it is worth clarifying so that people who have macports installed and use that to then install openmodelica will not be lead astray. It could just mention $prefix, or add a sentence that says something about "your local location for macports"....
comment:53 by , 9 years ago
Milestone: | Future → pre1.9.4 |
---|
It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.
comment:54 by , 7 years ago
Milestone: | pre1.9.4 → 1.9.4 |
---|
Removing the pre1.9.4 milestone in favor of 1.9.4.
I also tried to force deactivate boost, because this seems to be a boost related problem. But, then I get errors during the build related to OpenSceneGraph, because it requires boost.