EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: RE: linking to shared objects user libraries
From: "Mark Rivers" <[email protected]>
To: "Pierrick Hanlet" <[email protected]>
Cc: [email protected]
Date: Fri, 9 Jul 2010 11:20:53 -0500
Hi Pierrick,

I think your problem is the path to the library, not static versus
dynamic:

TargetMon_LIBS +=
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libMICECoreUt
ils

make[3]: *** No rule to make target
`../../../lib/linux-x86/lib/home/epics/Software/MICESoftware/MICETracker
Software/.lib/libMICECoreUtils.a', needed by `TargetMon'.  Stop.

Note that you have told it to look in 
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libMICECoreUt
ils

but it is reporting the unfound file as: 
`../../../lib/linux-x86/lib/home/epics/Software/MICESoftware/MICETracker
Software/.lib/libMICECoreUtils.a'

Which is going to be a non-existent path.

I am not sure exactly how to do this, because I have always used
libraries that were either part of the EPICS build or in standard
locations for the linker, like /usr/local/lib.  But I think in your
Makefile you need to specify just the name of the library like:

TargetMon_LIBS += MICECoreUtils

and separately tell it a library path where this file is located.

Mark


From: Pierrick Hanlet [mailto:[email protected]] 
Sent: Friday, July 09, 2010 11:12 AM
To: Mark Rivers
Cc: J. Lewis Muir; [email protected]
Subject: Re: RE: linking to shared objects user libraries

As requested:

------------------------------------------------------------------------
-----------------------------------------
~/iocTops/TargetMon/configure/CONFIG_SITE:
      1 # CONFIG_SITE
      2
      3 # Make any application-specific changes to the EPICS build
      4 # configuration variables in this file.
      5 #
      6 # Host/target specific settings can be specified in files named
      7 #  CONFIG_SITE.$(EPICS_HOST_ARCH).Common
      8 #  CONFIG_SITE.Common.$(T_A)
      9 #  CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
     10
     11 # Set this when you only want to compile this application
     12 # for a subset of the cross-compiled target architectures
     13 # that Base is built for.
     14 #CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
     15
     16 # Set this when your IOC and the host use different paths
     17 # to access the application. This will be needed to boot
     18 # from a Microsoft FTP server or with some NFS mounts.
     19 # You must rebuild in the iocBoot directory for this to
     20 # take effect.
     21 #IOCS_APPL_TOP = <path to application top as seen by IOC>
     22
     23 # If you don't want to install into $(TOP) then
     24 # define INSTALL_LOCATION here
     25 #INSTALL_LOCATION=<fullpathname>
     26
     27 STATIC_BUILD=NO
     28 SHARED_LIBRARIES=YES




Here's the makefile:
------------------------------------------------------------------------
-----------------------------------------
TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#  ADD MACRO DEFINITIONS AFTER THIS LINE

#=============================
# Build the IOC application

PROD_IOC = TargetMon

# TargetMon.dbd will be created and installed
DBD += TargetMon.dbd

# TargetMon.dbd will be made up from these files:
TargetMon_DBD += base.dbd
TargetMon_DBD += genSub.dbd
TargetMon_DBD += genSubRecord.dbd
TargetMon_DBD += dbGenSubExtra.dbd

# TargetMon_registerRecordDeviceDriver.cpp derives from TargetMon.dbd
TargetMon_SRCS += TargetMon_registerRecordDeviceDriver.cpp
TargetMon_SRCS += readTgtData.c

# Build the main IOC entry point on workstation OSs.
TargetMon_SRCS_DEFAULT += TargetMonMain.cpp
#TargetMon_SRCS_vxWorks += -nil-

# Add support from base/src/vxWorks if needed
#TargetMon_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary

USR_INCLUDES +=
-I/home/epics/Software/MICESoftware/MICETrackerSoftware/BeamLossMonitorU
tils/include

# Link in the code from the support library
TargetMon_LIBS +=
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libMICECoreUt
ils
TargetMon_LIBS +=
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libMICEThread
s
TargetMon_LIBS +=
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libMICELoggin
g
TargetMon_LIBS +=
/home/epics/Software/MICESoftware/MICETrackerSoftware/.lib/libBeamLossHa
rdwareUtils
TargetMon_LIBS += /home/epics/Software/ExtDeps/gzstream/gzstream
z_DIR = /usr/lib
USR_LIBS += z

# Finally link to the EPICS Base libraries
TargetMon_LIBS += $(EPICS_BASE_IOC_LIBS)
TargetMon_LIBS += genSub
TargetMon_LIBS += receive
TargetMon_LIBS += transmit

#=============================

include $(TOP)/configure/RULES
#----------------------------------------
#  ADD RULES AFTER THIS LINE


Here's the end of the compilation results:
------------------------------------------------------------------------
-----------------------------------------
/usr/bin/g++ -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS
-D_XOPEN_SOURCE=500           -D_X86_  -DUNIX  -D_BSD_SOURCE -Dlinux
-D_REENTRANT   -O3   -Wall      -m32     -g  -I. -I../O.Common -I. -I..
-I../../../include/os/Linux -I../../../include
-I/home/epics/epics/base/include/os/Linux
-I/home/epics/epics/base/include  -I/home/epics/epics/Support/include
-I/home/epics/epics/Support/genSub/include
-I/home/epics/Software/MICESoftware/MICETrackerSoftware/BeamLossMonitorU
tils/include    ../TargetMonMain.cpp
make[3]: *** No rule to make target
`../../../lib/linux-x86/lib/home/epics/Software/MICESoftware/MICETracker
Software/.lib/libMICECoreUtils.a', needed by `TargetMon'.  Stop.
make[3]: Leaving directory
`/home/epics/epics/iocTops/TargetMon/TargetMonApp/src/O.linux-x86'make[2
]: *** [install.linux-x86] Error 2
make[2]: Leaving directory
`/home/epics/epics/iocTops/TargetMon/TargetMonApp/src'
make[1]: *** [src.install] Error 2
make[1]: Leaving directory
`/home/epics/epics/iocTops/TargetMon/TargetMonApp'
make: *** [TargetMonApp.install] Error 2






------------------------------------------------------------------------
-----------------
Pierrick Hanlet
Fermilab, P.O. Box 500, M.S. 122
Batavia, IL 60510
[email protected]
(630)840-5555/8871/6039         office/lab/fax 
http://www-d0.fnal.gov/~hanlet 

"Whether you think you can or think you can't, either way, you are
correct" -- Henry Ford


----- Original Message -----
From: Mark Rivers <[email protected]>
Date: Friday, July 9, 2010 10:03 am
Subject: RE: linking to shared objects user libraries
To: Pierrick Hanlet <[email protected]>, "J. Lewis Muir" <[email protected]>
Cc: [email protected]


> Can you send the Makefile and the exact error message when you build?
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Pierrick Hanlet
> Sent: Friday, July 09, 2010 9:59 AM
> To: J. Lewis Muir
> Cc: [email protected]
> Subject: Re: linking to shared objects user libraries
> 
> 
> Thanks for the quick responses.
> 
> Yes, I did STATIC_BUILD=NO and SHARED_LIBRARIES=YES
> in xxx/configure/CONFIG_SITE.
> 
> Where might these be overwritten?  Also, since I'm using a 
> mixture of static and shared object libraries, will this
> configuration fix me to one type of library or another?
> Pierrick
> 
>
------------------------------------------------------------------------
> -----------------
> Pierrick Hanlet
> Fermilab, P.O. Box 500, M.S. 122
> Batavia, IL 60510
> [email protected]
> (630)840-5555/8871/6039         office/lab/fax 
> http://www-d0.fnal.gov/~hanlet 
> 
> "Whether you think you can or think you can't, either way, you are
> correct" -- Henry Ford
> 
> 
> ----- Original Message -----
> From: "J. Lewis Muir" <[email protected]>
> Date: Friday, July 9, 2010 9:50 am
> Subject: Re: linking to shared objects user libraries
> To: [email protected]
> 
> 
> > On 7/9/10 9:38 AM, Pierrick Hanlet wrote:
> > > 
> > > Hi,
> > > I'm using 3.14.11 on a linux machine. I would like to use several
> > > external (i.e. non-EPICS) .so libraries in my ioc makefile/
However,
> > > the linking appears to default to static libraries. According to
the
> > > applications developers guide, section 4.6.23.7, I should modify
> > > CONFIG_SITE, but this doesn't work.
> > >
> > > What should I do?
> > 
> > Hi, Pierrick.
> > 
> > Did you try setting both STATIC_BUILD=NO and SHARED_LIBRARIES=YES?
> > 
> > Also, check to make sure your IOC's configuration isn't changing
those
> > variables.  If it is, you will need to remove or change them their
> too.
> > 
> > Lewis


Replies:
Re: linking to shared objects user libraries Andrew Johnson
References:
linking to shared objects user libraries Pierrick Hanlet
Re: linking to shared objects user libraries J. Lewis Muir
Re: linking to shared objects user libraries Pierrick Hanlet
RE: linking to shared objects user libraries Mark Rivers
Re: RE: linking to shared objects user libraries Pierrick Hanlet

Navigate by Date:
Prev: Re: RE: linking to shared objects user libraries Pierrick Hanlet
Next: RE: RE: linking to shared objects user libraries Davidsaver, Michael
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: RE: linking to shared objects user libraries Pierrick Hanlet
Next: Re: linking to shared objects user libraries Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·