shared library compilation issue

58 views
Skip to first unread message

promach

unread,
Feb 27, 2019, 9:57:50 PM2/27/19
to xyce-users
I am trying to compile shared library as described in https://xyce.sandia.gov/documentation/XyceADMSGuide.html#XyceADMS_importing

However I faced some error:


make[3]: Entering directory '/home/phung/Documents/Grive/Personal/Analog/Xyce/src/Xyce-6.10/src'
  CCLD     libxyce.la
/usr/bin/ld: ../src/CircuitPKG/.libs/libCircuit.a(N_CIR_Xyce.o): relocation R_X86_64_PC32 against symbol `_ZTVN4Xyce5Stats4StatE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:784: libxyce.la] Error 1


Why ?

Trying to compile with  -fPIC also does not help.

Please see https://bbs.archlinux.org/viewtopic.php?pid=1834048#p1834048 for more context.

xyce-users

unread,
Feb 27, 2019, 10:23:41 PM2/27/19
to xyce-users
It is difficult to see what is wrong here because the linked context on the archlinux BBS appears not to be a full recompilation of Xyce after configure was invoked with the "--enable-shared" and "--enable-xyce-shareable" options.

Your configure line looks correct, but after configure is run and make invoked, nothing is getting compiled.  Did you try to reuse a build directory in which a non-shareable Xyce had been built?  If so, it may be that it is trying to use the existing, static libraries to link into a shared executable, and that isn't working (nor should it be expected to work).

Please try doing a "make clean" before "make" and see if the error persists.  Alternatively, make sure that configure and make are invoked in an empty directory.  If the error persists when doing a completely clean rebuild with the shared and shareable options, then please post your results.  But since we have used exactly these options in exactly this way and never had this problem, I believe that this is the core issue and that you'll have good results if you start with a clean build directory.

promach

unread,
Mar 1, 2019, 9:56:32 PM3/1/19
to xyce-users
I have followed your suggestion and did a "make clean" before "make"

The previous error had disappeared, yet a new error surfaced as follows :

Making all in XyceCInterface
make[2]: Entering directory '/home/phung/Documents/Grive/Personal/Analog/Xyce/src/Xyce-6.10/utils/XyceCInterface'
make[2]: *** No rule to make target '/N_CIR_XyceCInterface.C', needed by 'N_CIR_XyceCInterface.o'.  Stop.
make[2]: Leaving directory '/home/phung/Documents/Grive/Personal/Analog/Xyce/src/Xyce-6.10/utils/XyceCInterface'

Note: I have attached a log file for the complete build log for Xyce with shared library options.
xyce_build_log.txt

xyce-users

unread,
Mar 1, 2019, 11:09:19 PM3/1/19
to xyce-users
Thank you for pointing this error out.  You are the first person to encounter it, but I believe I understand why it is a problem for you.

This is a defect in how the Makefile.am for the XyceCInterface directory was constructed in Xyce 6.10 --- it is directly and improperly attempting to use the $VPATH variable in the rule for building XyceCInterface.o, and for some reason in your build this variable is coming up empty --- this is shown by the error that says it has no rule for making "/XyceCInterface.C".   If VPATH were properly being expanded in the make rule, it would be looking for that file in the directory pointed to by VPATH, not in "/".

I cannot account for why that might be, because in all of our testing on multiple systems that error has never surfaced before -- it is either a problem in how you are invoking configure, what version of make you're using, or something else entirely that I cannot begin to guess at.  For what it's worth, we build the shared library version of Xyce often and on many different systems and have never encountered this sort of problem.  But it was known that the build for the XyceCInterface directory was not correctly set up, so it is not that surprising that it has problems.

The build system for the XyceCInterface in the upcoming release of Xyce 6.11 was completely revamped and should not have this problem in the future.  VPATH should never have been getting used in this manner in that directory's makefile, and in the upcoming release it is not used that way.

The right answer to your problem is to figure out why VPATH is not set or used  correctly in your build, and why the correct setting of VPATH is not being used in your utils/XyceCInterface/Makefile in the first place.  But in the meantime, there may be a better way to get you up and running: I suspect that you probably don't need the XyceCInterface library to be built at all (it is an experimental and somewhat esoteric feature not for general consumption in Xyce 6.10), and the fastest way to fix this would probably be to disable it getting built at all.  Disabling this is relatively simple.

The best way to do that is to fix it directly in the Xyce source.  Edit the file utils/Makefile.am in your Xyce source tree, and comment out the line:
SUBDIRS = XyceCInterface

so it reads
#SUBDIRS = XyceCInterface


Then cd to the top of your Xyce source tree and run the command "./bootstrap" to regenerate configure and all the Makefile.in files.  You must have autoconf, automake, and libtool installed on your system for bootstrap to work.

Now reconfigure Xyce and rebuild.  The XyceCInterface directory will now be skipped.

Fortunately, this problem is not present in the upcoming release 6.11, so the suggestions in this email for how to work around the problem will not be needed after that release.

promach

unread,
Mar 2, 2019, 6:49:18 AM3/2/19
to xyce-users
Thanks for your rapid response.

See https://bbs.archlinux.org/viewtopic.php?pid=1834400#p1834400 for the successful build log

However I still face some warnings :


libtool: warning: remember to run 'libtool --finish /usr/lib'
/usr/bin/mkdir -p '/home/phung/Documents/Grive/Personal/Analog/Xyce/pkg/Xyce/usr/bin'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c Xyce '/home/phung/Documents/Grive/Personal/Analog/Xyce/pkg/Xyce/usr/bin'
libtool: warning: 'libxyce.la' has not been installed in '/usr/lib'
libtool: warning: '../src/DeviceModelPKG/ADMS/libADMS.la' has not been installed in '/usr/lib'
libtool: warning: '../src/DeviceModelPKG/NeuronModels/libNeuronModels.la' has not been installed in '/usr/lib'
libtool: install: /usr/bin/install -c .libs/Xyce /home/phung/Documents/Grive/Personal/Analog/Xyce/pkg/Xyce/usr/bin/Xyce



Other than this, the compiled Xyce binary package does not have the rlc.va in it. 
What compilation flags should I enable to copy the demo examples to the compiled binary package ?

[phung@archlinux Xyce]$ sudo locate -b "rlc.va"
/home/phung/Documents/Grive/Personal/Analog/Xyce/src/Xyce-6.10/user_plugin/rlc.va
/home/phung/Documents/Grive/Personal/Analog/Xyce/src/Xyce-6.10/utils/ADMS/examples/toys/rlc.va
[phung@archlinux Xyce]$ tar -tf Xyce-6.10-1-x86_64.pkg.tar.xz
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
.MTREE
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
.BUILDINFO
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
.PKGINFO
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/bin/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/bin/Xyce
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/bin/buildxyceplugin
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_ANP_NoiseData.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_ANP_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_CIR_GenCouplingSimulator.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_CIR_Xyce.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_CIR_Xygra.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_ADC.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_BJT.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Capacitor.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Configuration.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Const.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DAC.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Device.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceBlock.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceEntity.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceInstance.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceMaster.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceModel.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceOptions.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_DeviceSupport.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Diode.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_ExternData.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_ExternalSimulationData.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_InstanceName.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_MOSFET1.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Message.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Param.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Pars.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Resistor.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_SolverState.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_Units.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_VectorComputeInterface.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_DEV_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_ERH_Message.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_ERH_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_IO_CmdParse.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_IO_ExtOutInterface.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_IO_HangingResistor.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_IO_OutputTypes.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_IO_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LAS_Matrix.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LAS_MultiVector.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LAS_Vector.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LAS_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LOA_Loader.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_LOA_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_NLS_TwoLevelEnum.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_NLS_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_PDS_MPI.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_PDS_Manager.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_PDS_ParallelMachine.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_PDS_Serial.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_PDS_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_TIA_TwoLevelError.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_TIA_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_TOP_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_BreakPoint.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Diagnostic.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Expression.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_ExpressionData.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_ExpressionSymbolTable.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_FeatureTest.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_FormatTime.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_IndexPair.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Interface_Enum_Types.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_JSON.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_MachDepParams.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Marshal.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Math.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Misc.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_NameLevelKey.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_NetlistLocation.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_NoCase.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_NodeSymbols.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Op.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Pack.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Param.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_ReportHandler.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_StatMetricTraits.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Stats.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_TypeIndex.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_Xyce.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/N_UTL_fwd.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/include/Xyce_config.h
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/lib/
usr/lib/libADMS.so
usr/lib/libADMS.so.0
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/lib/libADMS.so.0.0.0
usr/lib/libNeuronModels.so
usr/lib/libNeuronModels.so.0
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/lib/libNeuronModels.so.0.0.0
usr/lib/libxyce.so
usr/lib/libxyce.so.0
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/lib/libxyce.so.0.0.0
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/libexec/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/libexec/libtool
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/html_params.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceBasicTemplates.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceBootstrapFile.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceHeaderFile.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceImplementationFile.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceMakefile.am.xml
tar: Ignoring unknown extended header keyword 'SCHILY.fflags'
usr/share/xml/xyceVersion.xml
[phung@archlinux Xyce]$

xyce-users

unread,
Mar 2, 2019, 12:42:39 PM3/2/19
to xyce-users
We cannot help you with the warnings you're seeing regarding the ".la" files not being installed.  Something went wrong in the actual installation process and a file that should have been installed in that process is not being found by the sanity check that libtool does.  Since it's just a warning, you might be able to ignore it.

rlc.va is not intended to be a part of the Xyce code that is normally installed.  It is a demo verilog-a file of extremely limited utility and the process of building plugins that it demonstrates is somewhat obsolete.  The Xyce installation process does not install its demos, although you *could* build the user plugin derived from rlc.va and install that by doing "make plugin" and "make install-plugin".  This will only install the shared library built from rlc.va, though, and it is somewhat pointless to do so as the resulting plugin won't really do anything useful.  If you want rlc.va installed to some examples directory, you will simply have to copy the file yourself.
Reply all
Reply to author
Forward
0 new messages