Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#2654 closed defect (fixed)

Mac openmodelica-devel with modelica3d fails to build

Reported by: Adam Dershowitz <dersh@…> Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Build Environment Version: trunk
Keywords: Cc:

Description

I wanted to try to view some simulations. I am building on a Mac. I tried to build with:
sudo port install openmodelica-devel +modelica3d

But it gives a build error. I have attached the log file. It looks like the problem is that it is attempted to copy libproc3d.so and libm3d-osg-gtk.so but these are built with the common Mac name suffix of .dylib.

Attachments (1)

main.log (3.1 MB ) - added by Adam Dershowitz <dersh@…> 11 years ago.
Build fail log file

Change History (15)

by Adam Dershowitz <dersh@…>, 11 years ago

Attachment: main.log added

Build fail log file

comment:1 by Adam Dershowitz <dersh@…>, 11 years ago

I also tried to run this simple example, without building with +modelica3d variant:
https://build.openmodelica.org/Documentation/OpenModelica.Scripting.loadModelica3D.html

I just did the default install.
I didn't really expect it to work, but the error that I get is not a link error, so I'm not sure if it some part of modelica3d is already being built, or what exactly is happening with it:

>> simulate(DoublePendulum)
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'DoublePendulum', options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "Failed to build model: DoublePendulum",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;
Warning: The initial conditions are not fully specified. Use +d=initialization for more information.
Error: Error building simulator. Build log: /usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum.o DoublePendulum.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_functions.o DoublePendulum_functions.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_records.o DoublePendulum_records.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_01exo.o DoublePendulum_01exo.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_02nls.o DoublePendulum_02nls.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_03lsy.o DoublePendulum_03lsy.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_04set.o DoublePendulum_04set.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_05evt.o DoublePendulum_05evt.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_06inz.o DoublePendulum_06inz.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_07dly.o DoublePendulum_07dly.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_08bnd.o DoublePendulum_08bnd.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_09alg.o DoublePendulum_09alg.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_10asr.o DoublePendulum_10asr.c
DoublePendulum_functions.c:20:3: warning: implicit declaration of function 'modbus_release_bus' is invalid in C99 [-Wimplicit-function-declaration]
  modbus_release_bus(_conn_ext);
  ^
DoublePendulum_functions.c:48:12: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
  if((tmp2 == (modelica_integer)_n))
      ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
DoublePendulum_functions.c:48:12: note: remove extraneous parentheses around the comparison to silence this warning
  if((tmp2 == (modelica_integer)_n))
     ~     ^                      ~
DoublePendulum_05evt.c:106:24: warning: assigning to 'int *' from 'const int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  *out_EquationIndexes = occurEqs[i];
                       ^ ~~~~~~~~~~~
DoublePendulum_05evt.c:114:3: warning: implicit declaration of function 'DoublePendulum_eqFunction_1478' is invalid in C99 [-Wimplicit-function-declaration]
  DoublePendulum_eqFunction_1478(data);
  ^
DoublePendulum_functions.c:48:12: note: use '=' to turn this equality comparison into an assignment
  if((tmp2 == (modelica_integer)_n))
           ^~
           =
DoublePendulum_functions.c:835:15: warning: implicit declaration of function 'modbus_acquire_session_bus' is invalid in C99 [-Wimplicit-function-declaration]
  _conn_ext = modbus_acquire_session_bus(_clientName);
              ^
DoublePendulum_functions.c:835:13: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
  _conn_ext = modbus_acquire_session_bus(_clientName);
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DoublePendulum_functions.c:876:3: warning: implicit declaration of function 'modbus_msg_release' is invalid in C99 [-Wimplicit-function-declaration]
  modbus_msg_release(_msg_ext);
  ^
DoublePendulum_functions.c:884:14: warning: implicit declaration of function 'modbus_msg_alloc' is invalid in C99 [-Wimplicit-function-declaration]
  _msg_ext = modbus_msg_alloc(_target, _object, _interface, _method);
             ^
DoublePendulum_functions.c:884:12: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
  _msg_ext = modbus_msg_alloc(_target, _object, _interface, _method);
           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DoublePendulum_functions.c:1094:16: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
      if((tmp4 == (modelica_integer) 0))
          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
DoublePendulum_functions.c:1094:16: note: remove extraneous parentheses around the comparison to silence this warning
      if((tmp4 == (modelica_integer) 0))
         ~     ^                      ~
DoublePendulum_functions.c:1094:16: note: use '=' to turn this equality comparison into an assignment
      if((tmp4 == (modelica_integer) 0))
               ^~
               =
8 warnings generated.
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_11mix.o DoublePendulum_11mix.c
2 warnings generated.
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_12jac.o DoublePendulum_12jac.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_13opt.o DoublePendulum_13opt.c
/usr/bin/clang       "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o DoublePendulum_14lnz.o DoublePendulum_14lnz.c
/usr/bin/clang -I. -o DoublePendulum DoublePendulum.o DoublePendulum_functions.o DoublePendulum_records.o DoublePendulum_01exo.o DoublePendulum_02nls.o DoublePendulum_03lsy.o DoublePendulum_04set.o DoublePendulum_05evt.o DoublePendulum_06inz.o DoublePendulum_07dly.o DoublePendulum_08bnd.o DoublePendulum_09alg.o DoublePendulum_10asr.o DoublePendulum_11mix.o DoublePendulum_12jac.o DoublePendulum_13opt.o DoublePendulum_14lnz.o "-I/opt/local/lib/omlibrary/ModelicaServices 3.2.1 modelica3d/Resources/Include" -I"/opt/local/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -lModelicaExternalC -lmodcount -lmodbus -ldbus-1        -L"/opt/local/lib/omc" -L"/opt/local/lib" -Wl,-rpath,"/opt/local/lib/omc" -Wl,-rpath,"/opt/local/lib"   -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 -lSimulationRuntimeC -llapack -lblas -lm -lgc
ld: library not found for -lmodcount
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [omc_main_target] Error 1


comment:2 by Adam Dershowitz <dersh@…>, 11 years ago

I also have been building with the +libraries variant. So that means that I have omlib-modelicaservices-3.2.1-modelica3d installed. So, it is not clear if I do need to use the +modelica3d variant to not.
Are these two separate?
If I look at the list file->system libraries I don't see anything related to 3d.

comment:3 by Martin Sjölund, 11 years ago

The libraries required for modelica3d are built by the openmodelica package (libmodcount, libmodbus, libproc3d) and is enabled by the +modelica3d flag.

comment:4 by Adam Dershowitz <dersh@…>, 11 years ago

But, the build fails with +modelica3d.

comment:5 by Martin Sjölund, 11 years ago

Component: BackendBuild Environment
Owner: changed from probably noone to Martin Sjölund
Status: newassigned

OK, that should work now. Close this if so.

comment:6 by Adam Dershowitz <dersh@…>, 11 years ago

No. Not working. Now it seems to build, but won't install.

It looks like this:

--->  Attempting to fetch openmodelica_21114.orig.tar.gz from http://build.openmodelica.org/apt/pool/contrib/
--->  Verifying checksums for openmodelica-devel                                     
--->  Extracting openmodelica-devel
--->  Configuring openmodelica-devel
--->  Building openmodelica-devel
--->  Staging openmodelica-devel into destroot
--->  Installing openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Activating openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Updating database of binaries
--->  Scanning binaries for linking errors               
--->  Found 1 broken file(s), matching files to ports    
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     openmodelica-devel @21114 +gfortran48+libraries+modelica3d+qt+sundials
--->  Computing dependencies for openmodelica-devel
--->  Cleaning openmodelica-devel
--->  Scanning binaries for linking errors
--->  Found 1 broken file(s), matching files to ports    
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     openmodelica-devel @21114 +gfortran48+libraries+modelica3d+qt+sundials
--->  Computing dependencies for openmodelica-devel
--->  Fetching distfiles for openmodelica-devel
--->  Verifying checksums for openmodelica-devel
--->  Extracting openmodelica-devel
--->  Configuring openmodelica-devel
--->  Building openmodelica-devel
--->  Staging openmodelica-devel into destroot
--->  Deactivating openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Uninstalling openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Computing dependencies for openmodelica-devel
--->  Installing openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Activating openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 1 broken file(s), matching files to ports    
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     openmodelica-devel @21114 +gfortran48+libraries+modelica3d+qt+sundials
--->  Computing dependencies for openmodelica-devel
--->  Fetching distfiles for openmodelica-devel
--->  Verifying checksums for openmodelica-devel
--->  Extracting openmodelica-devel
--->  Configuring openmodelica-devel
--->  Building openmodelica-devel
--->  Staging openmodelica-devel into destroot
--->  Deactivating openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Uninstalling openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Computing dependencies for openmodelica-devel
--->  Installing openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Activating openmodelica-devel @21114_0+gfortran48+libraries+modelica3d+qt+sundials
--->  Cleaning openmodelica-devel
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 1 broken file(s), matching files to ports    
Error: Port openmodelica-devel is still broken after rebuilding it more than 3 times.
Error: Please run port -d -y rev-upgrade and use the output to report a bug.
Port openmodelica-devel still broken after rebuilding 3 time(s)
    while executing
"error "Port $portname still broken after rebuilding [expr {$broken_port_counts($portname) - 1}] time(s)""
    (procedure "revupgrade_scanandrebuild" line 280)
    invoked from within
"revupgrade_scanandrebuild broken_port_counts $opts"
    (procedure "macports::revupgrade" line 5)
    invoked from within
"macports::revupgrade $opts"
    (procedure "action_revupgrade" line 2)
    invoked from within
"action_revupgrade $action $portlist $opts"
    (procedure "action_target" line 96)
    invoked from within
"$action_proc $action $portlist [array get global_options]"
    (procedure "process_cmd" line 93)
    invoked from within
"process_cmd $remaining_args"
    invoked from within
"if { [llength $remaining_args] > 0 } {

    # If there are remaining arguments, process those as a command
    set exit_status [process_cmd $remaining..."
    (file "/opt/local/bin/port" line 5254)

This gives some more info: sudo port -d -y rev-upgrade

Could not open /opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_21114/3rdParty/modelica3d/build/lib/proc3d/libproc3d.dylib: Error opening or reading file (referenced from /opt/local/lib/libm3d-osg-gtk.dylib)
DEBUG: Marking /opt/local/lib/libm3d-osg-gtk.dylib as broken

This looks a lot like this bug that showed up while trying to fix this, but then you were able to fix:
https://trac.openmodelica.org/OpenModelica/ticket/2701

comment:7 by Martin Sjölund, 11 years ago

Similar, but different. In this case, the .dylib has already been linked against.

comment:8 by Martin Sjölund, 11 years ago

I hope r21115 works because I should go prepare for a business trip early Sunday morning.

comment:9 by Adam Dershowitz <dersh@…>, 11 years ago

I was out, and could not try it until now. But, it doesn't work. Upgrade, or install, both report:

Error: openmodelica-devel: Error executing modelica3d: can't set "depends_lib": invalid depspec: configure.args-delete
Error: Unable to open port: Error evaluating variants
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

Have a good business trip.

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

Looks like it was just a typo. There was an extra end of line. This is in the Portfile:

  port:OpenSceneGraph \
configure.args-delete --disable-modelica3d

I changed deleted that line extension and now it builds:

  port:OpenSceneGraph 
configure.args-delete --disable-modelica3d

comment:11 by Adam Dershowitz <dersh@…>, 11 years ago

It does seem to build fine, but I can't seem to get it to run. I'm not sure if this ticket is the best place for this, but here goes:
In order to get dbus-server.py to run I had to install the py27-gobject3 port (so this should probably be a dependent port). dbus-server.py as included, just checked for Mac and exited with a message about it being untested. So, I changed it to this:

elif (platform.system() == 'Darwin'):
    viewer = CDLL("/opt/local/lib/libm3d-osg-gtk.dylib")  # GTK/OSG backend
    proc3d = CDLL("/opt/local/lib/libproc3d.dylib") # procedural 3d

Now, I can run it, and I get a message. "Running dbus-server..."

Next, I ran OMEdit, I unloaded ModelicaServices and then loaded "ModelicaServices 3.2.1 modelica3d". I then try to run Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum and it builds and starts to simulate. But there is no progress in the simulation window. It just hangs like that until I hit cancel.

So, I think that the above steps are correct. I am not sure if I have made a mistake in my running process, or if there is a bug in the Mac build.

comment:12 by Adam Dershowitz <dersh@…>, 11 years ago

Am I correct that ModelicaServices modelica3d should use dbus to connect to dbus-server.py. And, when run this way, the simulation will wait until it can successfully "talk". So, I think that the simulation is just not connecting, so it is just waiting to try before it can make any progress?

comment:13 by Martin Sjölund, 10 years ago

Resolution: fixed
Status: assignedclosed

This was fixed at some point... I think.

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

Yes, this now works. Thanks.

Note: See TracTickets for help on using tickets.