Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3056 closed defect (fixed)

Mac openmodelica-devel fails to build

Reported by: Adam Dershowitz <dersh@…> Owned by: adrpo
Priority: high Milestone: 1.9.4
Component: Build Environment Version: trunk
Keywords: Cc: sjoelund.se

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)

main.log (150.7 KB) - added by Adam Dershowitz <dersh@…> 10 years ago.
trace.txt (849.3 KB) - added by Adam Dershowitz <dersh@…> 10 years ago.
Trace file, as suggested
CMakeCache.txt (32.4 KB) - added by Adam Dershowitz <dersh@…> 10 years ago.
proc3d.dir.zip (33.8 KB) - added by Adam Dershowitz <dersh@…> 10 years ago.
/3rdParty/modelica3d/build/lib/proc3d/CMakeFiles/proc3d.dir
main.2.log (3.5 MB) - added by Adam Dershowitz <dersh@…> 10 years ago.
Build log with new flag

Change History (59)

Changed 10 years ago by Adam Dershowitz <dersh@…>

comment:1 Changed 10 years ago by Adam Dershowitz <dersh@…>

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.

comment:2 Changed 10 years ago by Adam Dershowitz <dersh@…>

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 Changed 10 years ago by Adam Dershowitz <dersh@…>

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 Changed 10 years ago by adrpo

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 Changed 10 years ago by adrpo

  • Cc sjoelund.se added
  • Component changed from Unknown to Build Environment
  • Owner changed from somebody to adeas31

comment:6 Changed 10 years ago by adrpo

  • Owner changed from adeas31 to adrpo
  • Status changed from new to accepted

comment:7 Changed 10 years ago by Adam Dershowitz <dersh@…>

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:8 Changed 10 years ago by adrpo

Please try with r25018 and let me know if it works.

comment:9 Changed 10 years ago by Adam Dershowitz <dersh@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

Yes, that did the job. It now builds.
thank you.

comment:10 Changed 10 years ago by Adam Dershowitz <dersh@…>

  • Resolution fixed deleted
  • Status changed from closed to 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:11 Changed 10 years ago by adrpo

Please try r25022.

comment:12 Changed 10 years ago by Adam Dershowitz <dersh@…>

Nope. r25032 gives the same error.

comment:13 Changed 10 years ago by adrpo

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 Changed 10 years ago by Adam Dershowitz <dersh@…>

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 Changed 10 years ago by adrpo

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.

Changed 10 years ago by Adam Dershowitz <dersh@…>

Trace file, as suggested

comment:16 Changed 10 years ago by Adam Dershowitz <dersh@…>

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 Changed 10 years ago by adrpo

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.

Changed 10 years ago by Adam Dershowitz <dersh@…>

comment:18 Changed 10 years ago by adrpo

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/

Last edited 10 years ago by adrpo (previous) (diff)

comment:19 Changed 10 years ago by Adam Dershowitz <dersh@…>

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

comment:20 Changed 10 years ago by adrpo

Ok. Just zip them and add them here.

comment:21 Changed 10 years ago by adrpo

I mean zip that directory using for example:

tar -jcf blah.tar.bz2 .

Changed 10 years ago by Adam Dershowitz <dersh@…>

/3rdParty/modelica3d/build/lib/proc3d/CMakeFiles/proc3d.dir

comment:22 Changed 10 years ago by adrpo

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 Changed 10 years ago by Adam Dershowitz <dersh@…>

Yup, it is there:

$ ls /opt/local/include/boost/array.hpp
/opt/local/include/boost/array.hpp

That is very strange!

comment:24 Changed 10 years ago by sjoelund.se

#include <array> does not include array.hpp. It requests a file called array.

comment:25 Changed 10 years ago by Adam Dershowitz <dersh@…>

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?

comment:26 follow-up: Changed 10 years ago by 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.

comment:27 Changed 10 years ago by adrpo

Try revision r25040.

comment:28 Changed 10 years ago by Adam Dershowitz <dersh@…>

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:29 Changed 10 years ago by sjoelund.se

Yeah, it could just be new boost that is being broken

comment:30 Changed 10 years ago by adrpo

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 Changed 10 years ago by adrpo

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:32 Changed 10 years ago by adrpo

I made it conditional only for APPLE now in r25042.

comment:33 in reply to: ↑ 26 Changed 10 years ago by perost

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 Changed 10 years ago by adrpo

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 Changed 10 years ago by adrpo

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.

comment:36 follow-up: Changed 10 years ago by sjoelund.se

It's crazy if boost starts requiring C++11 though :)
No ifdef to disable things requiring it?

comment:37 in reply to: ↑ 36 Changed 10 years ago by perost

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:38 Changed 10 years ago by Adam Dershowitz <dersh@…>

No luck!
I just tried to build r25043 and got the same "array" errors.

comment:39 Changed 10 years ago by adrpo

Ok. I will add the other flag too when i get back home.

comment:40 Changed 10 years ago by adrpo

Try r25045.

comment:41 Changed 10 years ago by Adam Dershowitz <dersh@…>

Well....that changed the error, but doesn't allow it to build. It now gives std related errors. The log is attached.

Changed 10 years ago by Adam Dershowitz <dersh@…>

Build log with new flag

comment:42 Changed 10 years ago by adrpo

Looks like we might need to add -std=c++11 -stdlib=libc++ to the linker flags also.

comment:43 Changed 10 years ago by adrpo

I will try to get access to a Mac as just playing with the flags forever is not a good way.

comment:44 Changed 10 years ago by adrpo

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 Changed 10 years ago by adrpo

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.

comment:46 follow-up: Changed 10 years ago by 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 :)

comment:47 in reply to: ↑ 46 Changed 10 years ago by adrpo

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 Changed 10 years ago by Adam Dershowitz <dersh@…>

  • Resolution set to fixed
  • Status changed from reopened to 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 Changed 10 years ago by sjoelund.se

/opt/openmodelica is on purpose, so people can use a local macports and the OpenModelica installer on the side

comment:50 Changed 10 years ago by Adam Dershowitz <dersh@…>

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:51 Changed 10 years ago by adrpo

I will add that in the user's guide.

comment:52 Changed 10 years ago by adrpo

Sort of handled in r25065. Good enough for now.

comment:53 Changed 9 years ago by dietmarw

  • Milestone changed from Future to 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 Changed 7 years ago by sjoelund.se

  • Milestone changed from pre1.9.4 to 1.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.