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

SCons always uses relative path even when absolute path is set with LIBPATH #3128

Closed
msbm97 opened this issue May 24, 2018 · 10 comments
Closed

Comments

@msbm97
Copy link

msbm97 commented May 24, 2018

I am compiling a complex project with multiple shared library which will be linked to a code not using scons so I need the registered paths to be absolute. My sconscript has the following code

common_build_dir = os.getcwd() + os.sep+ 'build' +os.sep() + 'common'

dynamic_lib = env.SharedLibrary(target = 'dynamic_lib',
source = [srcs],
LIBS = 'common',
LIBPATH= common_build_dir,
RPATH = common_build_dir
)

When I run otool the output is:
./lib/libTdynamic_lib.dylib:
build/dynamic_lib/libdynamic_lib.dylib (compatibility version 0.0.0, current version 0.0.0)
build/common/libcommon.dylib (compatibility version 0.0.0, current version 0.0.0)

and I can see from the build commands that scons is indeed omitting the complete path and only referencing from relative to wheres construct is defined.

PS: I tried joins the scons mailing list but have not received an approval email

@bdbaddog
Copy link
Contributor

which version of SCons, python, platform?
Also can you paste the relevant part of your build log?

@bdbaddog
Copy link
Contributor

check your spam folder for approval email.

@msbm97
Copy link
Author

msbm97 commented May 24, 2018

scons 3.0.1
python 2.7.14

Link Command:

gfortran -o build/dynamic_lib/libdynamic_lib.dylib -dynamiclib build/dynamic_lib/TprCntlSysSetpointFactorTblM.os build/dynamic_lib/TprTracTeePDM.os build/dynamic_lib/TprFluidFaceBoundCondPDM.os build/dynamic_lib/TprJunctionM.os build/dynamic_lib/TprNamelistM.os build/dynamic_lib/TprTracPumpPDM.os build/dynamic_lib/TprFeedbackTableItemM.os build/dynamic_lib/TprHalfJunctionM.os build/dynamic_lib/TprTracBreakSDM.os build/dynamic_lib/TprFluidCompPDM.os build/dynamic_lib/TprPowerShapeSDM.os build/dynamic_lib/TprFluidCellBoundCondPDM.os build/dynamic_lib/TprHtStrBCM.os build/dynamic_lib/TprTracHeatStructSDM.os build/dynamic_lib/TprTracPowerPDM.os build/dynamic_lib/TprTracChanPDM.os build/dynamic_lib/TprFluidBoundCondPDM.os build/dynamic_lib/TprWaterRodLocationsM.os build/dynamic_lib/TprPowerDistSDM.os build/dynamic_lib/TprAdjAddFlowLossM.os build/dynamic_lib/TprTracRadEncPDM.os build/dynamic_lib/TprContanForceJuncPDM.os build/dynamic_lib/TprTracFillPDM.os build/dynamic_lib/TprCntlSysBWRPresSDM.os build/dynamic_lib/TprTracSepdPDM.os build/dynamic_lib/TPRFileAccessM.os build/dynamic_lib/TprValveInterfacePDM.os build/dynamic_lib/TprHtStrGeneralPDM.os build/dynamic_lib/TprGlobalPDM.os build/dynamic_lib/TprHtStrSurfaceSDM.os build/dynamic_lib/TprTracPrizerSDM.os build/dynamic_lib/TprTimStpPDM.os build/dynamic_lib/TprTracPlenPDM.os build/dynamic_lib/TprKineticsPDM.os build/dynamic_lib/TprVolWeightingFactorsM.os build/dynamic_lib/TprControlSysGlobalPDM.os build/dynamic_lib/TprTracPipePDM.os build/dynamic_lib/TprListEntryM.os build/dynamic_lib/TprSpacerItemM.os build/dynamic_lib/TprTracBreakPDM.os build/dynamic_lib/TprTracTeeSDM.os build/dynamic_lib/TprTracPumpSDM.os build/dynamic_lib/TprCntlSysTripCtlTripM.os build/dynamic_lib/TprTracFillSDM.os build/dynamic_lib/TprContanForceJuncSDM.os build/dynamic_lib/TprTracSepdSDM.os build/dynamic_lib/TprCntlSysBWRPresPDM.os build/dynamic_lib/TprTracHeatStructPDM.os build/dynamic_lib/TprPowerShapePDM.os build/dynamic_lib/TprFluidCompSDM.os build/dynamic_lib/TprPowerDistPDM.os build/dynamic_lib/TprFluidBoundCondSDM.os build/dynamic_lib/TprTracChanSDM.os build/dynamic_lib/TprTracPowerSDM.os build/dynamic_lib/TprTracPrizerPDM.os build/dynamic_lib/TprCssControllerM.os build/dynamic_lib/TprComponentDimensionsM.os build/dynamic_lib/TprHtStrSurfacePDM.os build/dynamic_lib/TprTracPlenSDM.os build/dynamic_lib/TprTimStpSDM.os build/dynamic_lib/TprValveInterfaceSDM.os build/dynamic_lib/PibIntrTypeM.os build/dynamic_lib/TprVesselPDAxisParametersM.os build/dynamic_lib/TprHtStrGeneralSDM.os build/dynamic_lib/TprGlobalSDM.os build/dynamic_lib/TprVesselSDAxisParametersM.os build/dynamic_lib/TprControlSysGlobalSDM.os build/dynamic_lib/TprLegacyFluidM.os build/dynamic_lib/TprTracPipeSDM.os build/dynamic_lib/TprMaterialItemM.os build/dynamic_lib/TprPressControllerM.os build/dynamic_lib/TprKineticsSDM.os build/dynamic_lib/TprNamelistTripletM.os build/dynamic_lib/TprContanTHSSDM.os build/dynamic_lib/TprTracJetpPDM.os build/dynamic_lib/CPibFacesM.os build/dynamic_lib/TprCntlSysBWRFlowPDM.os build/dynamic_lib/XdrM.os build/dynamic_lib/TprJunctionListM.os build/dynamic_lib/TprTracVesselSDM.os build/dynamic_lib/TprVesselSDM.os build/dynamic_lib/TprContanPassJuncSDM.os build/dynamic_lib/TprVesselExtractM.os build/dynamic_lib/TprHPStdyStM.os build/dynamic_lib/TprNamelistArrayTripletM.os build/dynamic_lib/TprPumpInterfaceSDM.os build/dynamic_lib/TprTprListM.os build/dynamic_lib/TprContanCoolerSDM.os build/dynamic_lib/TprAdjAddFlowLossCEM.os build/dynamic_lib/TprFluidSegmentSDM.os build/dynamic_lib/TprTracFluidPowerPDM.os build/dynamic_lib/TprTracCanChanPDM.os build/dynamic_lib/TprContanFanCoolerSDM.os build/dynamic_lib/TprPinPowM.os build/dynamic_lib/TprSensCoefsM.os build/dynamic_lib/TprTracHeatrSDM.os build/dynamic_lib/TprFileHeaderM.os build/dynamic_lib/TprMaterialsM.os build/dynamic_lib/TprTracContanPDM.os build/dynamic_lib/TprCntlSysTripSDM.os build/dynamic_lib/TprTracExterSDM.os build/dynamic_lib/TprMechSepdGeometryM.os build/dynamic_lib/TprSpacerGridsM.os build/dynamic_lib/TprContanSourceSinkSDM.os build/dynamic_lib/TprCntlSysSigVarPDM.os build/dynamic_lib/TprTable2DblM.os build/dynamic_lib/TprTracTurbPDM.os build/dynamic_lib/TprUserDefUnitsM.os build/dynamic_lib/TprSensCoefficientM.os build/dynamic_lib/TprContanCompartPDM.os build/dynamic_lib/TprSjcDataM.os build/dynamic_lib/TprHSSCDAPCompWFM.os build/dynamic_lib/TprSDEditM.os build/dynamic_lib/TprComponentActionSDM.os build/dynamic_lib/TprPowerSDM.os build/dynamic_lib/TprCntlSysCntlBlockSDM.os build/dynamic_lib/TprGeneralTablePDM.os build/dynamic_lib/TprConstrStdyStM.os build/dynamic_lib/TprTracValveSDM.os build/dynamic_lib/TprContanHSSDM.os build/dynamic_lib/TprCntlSysBWRWLevSDM.os build/dynamic_lib/TprTracVesselPDM.os build/dynamic_lib/TprContanDimensionsM.os build/dynamic_lib/TprContanPassJuncPDM.os build/dynamic_lib/TprVesselPDM.os build/dynamic_lib/TprTracJetpSDM.os build/dynamic_lib/TprContanTHSPDM.os build/dynamic_lib/TprCntlSysBWRFlowSDM.os build/dynamic_lib/TprCellLocationM.os build/dynamic_lib/TprFluidSegmentPDM.os build/dynamic_lib/TprFeedbackTblCoordDataM.os build/dynamic_lib/TprTracFluidPowerSDM.os build/dynamic_lib/TprCntlSysTripTsDomainM.os build/dynamic_lib/TprContanCoolerPDM.os build/dynamic_lib/TprPumpInterfacePDM.os build/dynamic_lib/TprUnitDataitemM.os build/dynamic_lib/TprTable1DblM.os build/dynamic_lib/TprTracExterPDM.os build/dynamic_lib/TprCntlSysTripPDM.os build/dynamic_lib/TprSignalSubExpressionM.os build/dynamic_lib/TprTracContanSDM.os build/dynamic_lib/TprCntlSysTripSigExpressionM.os build/dynamic_lib/TprContanFanCoolerPDM.os build/dynamic_lib/TprTracCanChanSDM.os build/dynamic_lib/TprCntlSysTripDumpM.os build/dynamic_lib/TprTimStpPDitemM.os build/dynamic_lib/TprTracHeatrPDM.os build/dynamic_lib/TprGeneralTableSDM.os build/dynamic_lib/TprPowerPDM.os build/dynamic_lib/TprCntlSysCntlBlockPDM.os build/dynamic_lib/TprComponentActionPDM.os build/dynamic_lib/TprTracValvePDM.os build/dynamic_lib/TprContanHSPDM.os build/dynamic_lib/TprCntlSysBWRWLevPDM.os build/dynamic_lib/TprTracTurbSDM.os build/dynamic_lib/TprCCFLitemM.os build/dynamic_lib/TprCntlSysSigVarSDM.os build/dynamic_lib/TprContanSourceSinkPDM.os build/dynamic_lib/TprCCFLM.os build/dynamic_lib/TprEvalTblFunctionM.os build/dynamic_lib/TprContanCompartSDM.os build/dynamic_lib/TprSoluteM.os -Lbuild/common -lcommon

@bdbaddog
Copy link
Contributor

MacOS ?

@msbm97
Copy link
Author

msbm97 commented May 24, 2018

yes that is correct. I am sorry I missed where you were requesting the platform also.

@bdbaddog
Copy link
Contributor

o.k. Yes. This is expected behavior. SCons will always normalize string paths to relative.
You might try Dir(your path) instead of the string and see if that makes any difference.

@bdbaddog
Copy link
Contributor

Please try signing up for users mailing list again..

@msbm97
Copy link
Author

msbm97 commented May 25, 2018

I tried what you suggested and made the following change to my script

newBuildDir = DIR(common_build_dir)

dynamic_lib = env.SharedLibrary(target = 'dynamic_lib',
source = srcs,
LIBS = 'common',
LIBPATH= newBuildDir,
RPATH = newBuildDir

Unfortunately, it didn't seem to make any difference the output of otool -L dynamic_lib.dylib still showed the relative path.

Is there anything else I can do to get scons register the absolute path? It will be a pain if the files always register relative paths because I have 7 projects which have varying levels of dependency on each other.

I got the confirmation email and I am now in the scons user groups.

@bdbaddog
Copy link
Contributor

bdbaddog commented May 25, 2018 via email

@bdbaddog
Copy link
Contributor

I'm going to close this issue as it seems the real issue was getting RPATH to work?

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

No branches or pull requests

2 participants