Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3378 closed defect (fixed)

Macport OM Install fails

Reported by: dersh Owned by: sjoelund.se
Priority: high Milestone: 1.9.4
Component: Build Environment Version: trunk
Keywords: Cc:

Description

OM is now successfully building again on Hudson. But, when I tried to install r475, it compiles, but then macports reports an error. The end of the install shows up like this:

--->  Found 7 broken file(s), matching files to ports    
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     openmodelica-devel @1.9.3~dev-475-gb6f222e +gfortran48+libraries+modelica3d+omnotebook+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 @1.9.3~dev-475-gb6f222e_0+gfortran48+libraries+modelica3d+omnotebook+qt+sundials
--->  Cleaning openmodelica-devel
--->  Uninstalling openmodelica-devel @1.9.3~dev-475-gb6f222e_0+gfortran48+libraries+modelica3d+omnotebook+qt+sundials
--->  Cleaning openmodelica-devel
--->  Computing dependencies for openmodelica-devel
--->  Installing openmodelica-devel @1.9.3~dev-475-gb6f222e_0+gfortran48+libraries+modelica3d+omnotebook+qt+sundials
--->  Activating openmodelica-devel @1.9.3~dev-475-gb6f222e_0+gfortran48+libraries+modelica3d+omnotebook+qt+sundials
--->  Cleaning openmodelica-devel
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  Found 7 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 103)
    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 5268)

I have run the suggested command and will attach that log file.

I believe that the problem is that several dynamic libraries are being installed in the correct locations, but then the path, encoded in the binaries, are the temporary build directories used by macport, instead of the install location.
Specically: libModelicaExternalC.0.dylib,libqjson.0.dylib and libcoinmumps.1.dylib
So, for example, OMEdit tries to use this:

/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_1.9.3~dev-475-gb6f222e/build/lib/x86_64-darwin14.3.0/omc/libModelicaExternalC.0.dylib

When that library is installed, correctly, here:

/opt/local/lib/x86_64-darwin14.3.0/omc/libModelicaExternalC.0.dylib

And, the binary should just use rpath, as it does for most libraries.

If I manually correct OMEdit and libOpenModelicaCompiler.dylib to the correct search paths, using install_name_tool, I can get OMEdit to run. And some models then simulate fine, while for others the binary model itself still searches in the build location for libModelicaExternalC.0.dylib, so the model itself has to be manually corrected as well, to run.

Attachments (1)

OM_Upgrade_rev-upgrade.txt (404.1 KB) - added by dersh 9 years ago.
output of rev-upgrade

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by dersh

output of rev-upgrade

comment:1 Changed 9 years ago by dersh

By manually correcting each of the paths in omc, libOpenModelicaCompiler.dylib, OMEdit, OMNotebook, and libipopt.0.0.0.dylib, I can get Macports to stop trying to rebuild every time, and I can get OMEdit to run.
If I don't do these fixes, whenever I update anything else in Macports, it attempts to rebuild openmodelica three times, and then gives an error.
But, if I simulate some simple examples, such as Modelica.Blocks.Examples.Filter, the actual simulation that is built, still has the wrong dynamic library path embedded in it for libModelicaExternalC, so running the simulation fails. If I then manually change that binary, outside of OMEdit, then it can run, outside of OMEdit.

comment:2 Changed 9 years ago by Benjamin Häfele <ben.haefele@…>

Same error with here with openmodelica-devel @1.9.3~dev-557-g53ff301_0

Building openmodelica-devel
--->  Staging openmodelica-devel into destroot
--->  Installing openmodelica-devel @1.9.3~dev-557-g53ff301_0+gfortran49+libraries+omnotebook+qt+sundials
--->  Activating openmodelica-devel @1.9.3~dev-557-g53ff301_0+gfortran49+libraries+omnotebook+qt+sundials
--->  Cleaning openmodelica-devel
--->  Updating database of binaries
--->  Scanning binaries for linking errors               
--->  Found 7 broken file(s), matching files to ports    
--->  Found 1 broken port(s), determining rebuild order
--->  Rebuilding in order
     openmodelica-devel @1.9.3~dev-557-g53ff301 +gfortran49+libraries+omnotebook+qt+sundials

comment:3 Changed 9 years ago by dersh

The following is more detail about the way to manually fix things to make it work. After macport finishes attempting the rebuilds you can do this:

otool -L  /Applications/MacPorts/OMEdit.app/Contents/MacOS/OMEdit

And then copy the build path and put it into a variable. For my newest build I did this (your specific path will be different):

export work_path=/opt/local/var/macports/build/_opt_local_var_macports_sources_build.openmodelica.org_macports_lang_openmodelica-devel/openmodelica-devel/work/openmodelica_1.9.3~dev.beta-4-g74e0b31

Finally, here are all the commands that I think fix everything:

sudo install_name_tool -change $work_path/build/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib  @rpath/libModelicaExternalC.0.dylib /Applications/MacPorts/OMEdit.app/Contents/MacOS/OMEdit

sudo install_name_tool -change $work_path/OMEdit/qjson/build/lib/libqjson.0.dylib /opt/local//lib/x86_64-darwin14.5.0/omc/libqjson.0.dylib /Applications/MacPorts/OMEdit.app/Contents/MacOS/OMEdit

sudo install_name_tool -change $work_path/build/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib  @rpath/libModelicaExternalC.0.dylib /Applications/MacPorts/OMNotebook.app/Contents/MacOS/OMNotebook

sudo install_name_tool -change $work_path/build/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib  @rpath/libModelicaExternalC.0.dylib  /opt/local/lib/x86_64-darwin14.5.0/omc/libOpenModelicaCompiler.dylib

sudo install_name_tool -change $work_path/build/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib  @rpath/libModelicaExternalC.0.dylib  /opt/local/bin/omc

sudo install_name_tool -change $work_path/build/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib  @rpath/libModelicaExternalC.0.dylib  /opt/local/bin/libOpenModelicaCompiler.dylib

sudo install_name_tool -change $work_path/OMCompiler/3rdParty/Ipopt/lib/libcoinmumps.1.dylib /opt/local/lib/x86_64-darwin14.5.0/omc/libcoinmumps.1.dylib /opt/local/lib/x86_64-darwin14.5.0/omc/libipopt.0.0.0.dylib

sudo install_name_tool -id @rpath/libModelicaExternalC.0.dylib  /opt/local/lib/x86_64-darwin14.5.0/omc/libModelicaExternalC.0.dylib

sudo install_name_tool -id @rpath/libModelicaStandardTables.0.dylib  /opt/local/lib/x86_64-darwin14.5.0/omc/libModelicaStandardTables.0.dylib

sudo install_name_tool -id @rpath/libqjson.0.dylib /opt/local/lib/x86_64-darwin14.5.0/omc/libqjson.0.dylib
sudo install_name_tool -change $work_path/OMEdit/qjson/build/lib/libqjson.0.dylib /opt/local//lib/x86_64-darwin14.5.0/omc/libqjson.0.dylib /opt/local/lib/x86_64-darwin14.5.0/omc/libqjson.0.8.1.dylib

sudo install_name_tool -change $work_path/OMEdit/qjson/build/lib/libqjson.0.dylib /opt/local//lib/x86_64-darwin14.5.0/omc/libqjson.0.dylib /opt/local/lib/x86_64-darwin14.5.0/omc/libqjson.dylib


These should be done by part of the make process, but are missing for some reason.

comment:4 Changed 9 years ago by dersh

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

comment:5 Changed 9 years ago by dersh

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

Looks like it is again able to build and install (1.9.3~dev.beta2-15-g06dc31c_0). I saw a few changesets related to OSX that were submitted, so some combination of those fixed it.
Thanks,

comment:6 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:7 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.