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  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: compile error in ADExample/simDetector with opencv
From: Alireza Panna <[email protected]>
To: "Johnson, Andrew N." <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 4 Aug 2016 00:07:49 -0400
Hi,

So compiling areadetector with ADPluginEdge using opencv-3.1.0 and EPICS_HOST_ARCH=windows-x64-static (with static build=yes, shared libraries=no). This is where it throws an error:

make[7]: *** No rule to make target `../../../lib/windows-x64-static/opencv_world310.lib', needed by `simDetectorNoIOCApp.exe'.  Stop.
make[7]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/simDetectorNoIOC/simDetectorNoIOCApp/src/O.windows-x64-static'
make[6]: *** [install.windows-x64-static] Error 2
make[6]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/simDetectorNoIOC/simDetectorNoIOCApp/src'
make[5]: *** [src.install] Error 2
make[5]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/simDetectorNoIOC/simDetectorNoIOCApp'
make[4]: *** [simDetectorNoIOCApp.install] Error 2
make[4]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/simDetectorNoIOC'
make[3]: *** [simDetectorNoIOC.install] Error 2
make[3]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs'
make[2]: *** [iocs.install] Error 2
make[2]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample'
make[1]: *** [C:\Epics\support\areaDetector-2-4/ADExample.install] Error 2
make[1]: Leaving directory `C:/Epics/support/areaDetector-2-4'
make: *** [C:/Epics/support/areaDetector-2-4.install] Error 2

Again i have the following in my commonDriverMakefile:
ifdef ADPLUGINEDGE
  PROD_LIBS             += NDPluginEdge
  $(PROD_NAME)_DBD      += NDPluginEdge.dbd
  ifdef OPENCV_LIB
    opencv_core_DIR     += $(OPENCV_LIB)
    PROD_LIBS           += opencv_world310
  else
    PROD_SYS_LIBS       += opencv_world310
  endif
endif

Then I try compiling dynamic i.e. EPICS_HOST_ARCH=windows-x64 (STATIC_BUILD=NO, SHARED_LIBRARIES=YES) This is the result when i try to compile areadetector with opencv and the edge plugin.

   Creating library NDPluginEdge.lib and object NDPluginEdge.exp
NDPluginEdge.obj : error LNK2001: unresolved external symbol "void __cdecl cv::blur(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::Size_<int>,class cv::Point_<int>,int)" (?blur@cv@@YAXAEBV_InputArray@1@AEBV_OutputArray@1@V?$Size_@H@1@V?$Point_@H@1@H@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPEAX@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QEAAXXZ)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::Mat::create(int,int const *,int)" (?create@Mat@cv@@QEAAXHPEBHH@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "void __cdecl cv::Canny(class cv::_InputArray const &,class cv::_OutputArray const &,double,double,int,bool)" (?Canny@cv@@YAXAEBV_InputArray@1@AEBV_OutputArray@1@NNH_N@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: virtual enum asynStatus __cdecl NDPluginDriver::setArrayInterrupt(int)" (__imp_?setArrayInterrupt@NDPluginDriver@@EEAA?AW4asynStatus@@H@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual enum asynStatus __cdecl NDPluginDriver::connectToArrayPort(void)" (__imp_?connectToArrayPort@NDPluginDriver@@MEAA?AW4asynStatus@@XZ)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void __cdecl NDPluginDriver::processCallbacks(class NDArray *)" (__imp_?processCallbacks@NDPluginDriver@@MEAAXPEAVNDArray@@@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __cdecl NDPluginDriver::processTask(void)" (__imp_?processTask@NDPluginDriver@@UEAAXXZ)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __cdecl NDPluginDriver::driverCallback(struct asynUser *,void *)" (__imp_?driverCallback@NDPluginDriver@@UEAAXPEAUasynUser@@PEAX@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual enum asynStatus __cdecl NDPluginDriver::readInt32Array(struct asynUser *,int *,unsigned __int64,unsigned __int64 *)" (__imp_?readInt32Array@NDPluginDriver@@UEAA?AW4asynStatus@@PEAUasynUser@@PEAH_KPEA_K@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual enum asynStatus __cdecl NDPluginDriver::writeOctet(struct asynUser *,char const *,unsigned __int64,unsigned __int64 *)" (__imp_?writeOctet@NDPluginDriver@@UEAA?AW4asynStatus@@PEAUasynUser@@PEBD_KPEA_K@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual enum asynStatus __cdecl NDPluginDriver::writeInt32(struct asynUser *,int)" (__imp_?writeInt32@NDPluginDriver@@UEAA?AW4asynStatus@@PEAUasynUser@@H@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl NDPluginDriver::NDPluginDriver(char const *,int,int,char const *,int,int,int,int,unsigned __int64,int,int,int,int,int,int)" (__imp_??0NDPluginDriver@@QEAA@PEBDHH0HHHH_KHHHHHH@Z)
NDPluginEdge.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl NDPluginDriver::~NDPluginDriver(void)" (__imp_??1NDPluginDriver@@UEAA@XZ)
NDPluginEdge.dll : fatal error LNK1120: 15 unresolved externals
make[4]: *** [NDPluginEdge.dll] Error 1120
make[4]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADPluginEdge/edgeApp/edgeSrc/O.windows-x64'
make[3]: *** [install.windows-x64] Error 2
make[3]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADPluginEdge/edgeApp/edgeSrc'
make[2]: *** [edgeSrc.install] Error 2
make[2]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADPluginEdge/edgeApp'
make[1]: *** [edgeApp.install] Error 2
make[1]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADPluginEdge'
make: *** [C:\Epics\support\areaDetector-2-4/ADPluginEdge.install] Error 2

So with dynamic build, ADPluginEdge does not compile out of the box. 

​Best,
Ali

On Wed, Aug 3, 2016 at 10:15 PM, Alireza Panna <[email protected]> wrote:
Hi Andrew, 
That's what I thought as well. On windows I always build static for production use. I can stick to the new convention from now on and set it to windows-x64-static so its more easy to distinguish. 

Thanks

Best,
Ali

On Wed, Aug 3, 2016 at 10:04 PM, Johnson, Andrew N. <[email protected]> wrote:
Hi Ali,

The windows-x64-static target is just a predefined way of doing exactly what you do, there should be no difference in the result. We originally added that target so we could easily run test-builds of both static and dynamic Windows targets on our Jenkins CI server side-by-side.

- Andrew

-- 
Sent from my iPad

On Aug 3, 2016, at 9:37 PM, Alireza Panna <[email protected]> wrote:

Hi Mark,

Ok. To build base as static I normally just set STATIC_BUILD=YES and SHARED_LIBRARIES=NO in $(EPICS_BASE)/configure/CONFIG_SITE and then set EPICS_HOST_ARCH=windows-x64. This results in no dlls being built in the bin directory of EPICS_BASE. I did not know I had to set it as windows-x64-static even when I set static build as YES. I will recompile by setting the arch as windows-x64-static and see if that works.

Thanks for your help.

Best,
Ali

On Wed, Aug 3, 2016 at 9:11 PM, Mark Rivers <[email protected]> wrote:
By dynamic I mean that you are building windows-x64 rather than windows-x64-static.  By default that is a dynamic (using dlls) build.

Mark


Mark



Sent from my iPhone

On Aug 3, 2016, at 5:17 PM, Alireza Panna <[email protected]<mailto:[email protected]>> wrote:

Hi Mark,

Thanks for the quick reply. I added this in the commonLibraryMakefile:
ifdef ADPLUGINEDGE
  ifdef OPENCV_LIB
    opencv_core_DIR     += $(OPENCV_LIB)
    LIB_LIBS           += opencv_world310
  else
    LIB_SYS_LIBS       += opencv_world310
  endif
endif

now in the commonDriverMakefile, i just have the following:
ifdef ADPLUGINEDGE
  PROD_LIBS             += NDPluginEdge
  $(PROD_NAME)_DBD      += NDPluginEdge.dbd
endif
I get the following error now after doing make realclean realuninstall && make
NDPluginEdge.lib(NDPluginEdge.obj) : error LNK2001: unresolved external symbol "
void __cdecl cv::blur(class cv::_InputArray const &,class cv::_OutputArray const
 &,class cv::Size_<int>,class cv::Point_<int>,int)" (?blur@cv@@YAXAEBV_InputArra
y@1@AEBV_OutputArray@1@V?$Size_@H@1@V?$Point_@H@1@H@Z)
NDPluginEdge.lib(NDPluginEdge.obj) : error LNK2001: unresolved external symbol "
void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPEAX@Z)
NDPluginEdge.lib(NDPluginEdge.obj) : error LNK2001: unresolved external symbol "
public: void __cdecl cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QEAAXXZ)
NDPluginEdge.lib(NDPluginEdge.obj) : error LNK2001: unresolved external symbol "
public: void __cdecl cv::Mat::create(int,int const *,int)" (?create@Mat@cv@@QEAA
XHPEBHH@Z)
NDPluginEdge.lib(NDPluginEdge.obj) : error LNK2001: unresolved external symbol "
void __cdecl cv::Canny(class cv::_InputArray const &,class cv::_OutputArray cons
t &,double,double,int,bool)" (?Canny@cv@@YAXAEBV_InputArray@1@AEBV_OutputArray@1
@NNH_N@Z)
ADCSimDetectorApp.exe : fatal error LNK1120: 5 unresolved externals
make[6]: *** [ADCSimDetectorApp.exe] Error 1120
make[6]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/ADC
SimDetectorIOC/ADCSimDetectorApp/src/O.windows-x64'
make[5]: *** [install.windows-x64] Error 2
make[5]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/ADC
SimDetectorIOC/ADCSimDetectorApp/src'
make[4]: *** [src.install] Error 2
make[4]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/ADC
SimDetectorIOC/ADCSimDetectorApp'
make[3]: *** [ADCSimDetectorApp.install] Error 2
make[3]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/ADC
SimDetectorIOC'
make[2]: *** [ADCSimDetectorIOC.install] Error 2
make[2]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs'
make[1]: *** [iocs.install] Error 2
make[1]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample'
make: *** [C:\Epics\support\areaDetector-2-4/ADExample.install] Error 2

I then switched to staticlib for opencv. My config_site.local now looks like this:



OPENCV          = C:/opencv-2.4.13
OPENCV_LIB      = $(OPENCV)/build/x64/vc12/staticlib
OPENCV_INCLUDE  = -I$(OPENCV)/build/include/

​and the commonDriverMakefile:
​ifdef ADPLUGINEDGE
  PROD_LIBS             += NDPluginEdge
  $(PROD_NAME)_DBD      += NDPluginEdge.dbd
  ifdef OPENCV_LIB
    opencv_core_DIR     += $(OPENCV_LIB)
    PROD_LIBS           += opencv_core2413 opencv_imgproc2413
  else
    PROD_SYS_LIBS       += opencv_core2413 opencv_imgproc2413
  endif
endif

In this case I still get a similar error as before.
make[6]: *** No rule to make target `../../../lib/windows-x64/opencv_core2413.li<http://opencv_core2413.li>
b', needed by `simDetectorNoIOCApp.exe'.  Stop.​

When you say building dynamic I assume you mean the opencv libs I am using are built dynamic, i build epics base as static.

Thanks

Ali

On Wed, Aug 3, 2016 at 3:04 PM, Mark Rivers <[email protected]<mailto:[email protected]>> wrote:
Because you are building dynamically you also need to define LIB_LIBS the same way you defined PROD_LIBS.

If this works you could make a pull request for the fix.

Thanks,
Mark


Sent from my iPhone

On Aug 3, 2016, at 2:06 PM, Alireza Panna <[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>> wrote:

Hi,

I am trying to use ADPluginEdge with the sim detector and I run into the following error:

make[6]: Entering directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/si
mDetectorNoIOC/simDetectorNoIOCApp/src/O.windows-x64'
cl /nologo /EHsc /GR -c              /favor:blend   /nologo /D__STDC__=0 /D_CRT_
SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE   /Ox /GL   /W3 /w44355     -DH5
_BUILT_AS_STATIC_LIB    /MT -DEPICS_DLL_NO /TP   -I. -I..\\O.Common -I. -I.. -I.
.\\..\\..\\include\\os\\WIN32 -I..\\..\\..\\include  -I..\\..\\..\\..\\..\\inclu
de     -IC:\Epics\base-3.14.12.5\\include\\os\\WIN32 -IC:\Epics\base-3.14.12.5\\
include  -IC:\Epics\support\\asyn-4-29\\include -IC:\Epics\support\areaDetector-
2-5\\ADBinaries\\include\\os\\WIN32 -IC:\Epics\support\areaDetector-2-4\\ADBinar
ies\\include -IC:\Epics\support\areaDetector-2-4\\ADCore\\include\\os\\WIN32 -IC
:\Epics\support\areaDetector-2-4\\ADCore\\include -IC:\Epics\support\\autosave-5
-7-1\\include\\os\\WIN32 -IC:\Epics\support\\autosave-5-7-1\\include  -IC:\Epics
\support\\busy-1-6-1\\include  -IC:\Epics\support\\calc-3-2\\include  -IC:\Epics
\support\\seq-2-1-18\\include  -IC:\Epics\support\\sscan-2-10-1\\include -IC:\Ep
ics\support\\devIocStats-3-1-14\\include\\os\\WIN32 -IC:\Epics\support\\devIocSt
ats-3-1-14\\include  -IC:\Epics\support\\caPutLog-3-4\\include       -I\\usr\\lo
cal64\\include  -I\\usr\\include\\libxml2    ..\\simDetectorNoIOC.cpp
simDetectorNoIOC.cpp
make[6]: *** No rule to make target `../../../lib/windows-x64/opencv_world310.li<http://opencv_world310.li><http://opencv_world310.li>
b', needed by `simDetectorNoIOCApp.exe'.  Stop.
make[6]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/sim
DetectorNoIOC/simDetectorNoIOCApp/src/O.windows-x64'
make[5]: *** [install.windows-x64] Error 2
make[5]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/sim
DetectorNoIOC/simDetectorNoIOCApp/src'
make[4]: *** [src.install] Error 2
make[4]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/sim
DetectorNoIOC/simDetectorNoIOCApp'
make[3]: *** [simDetectorNoIOCApp.install] Error 2
make[3]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs/sim
DetectorNoIOC'
make[2]: *** [simDetectorNoIOC.install] Error 2
make[2]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample/iocs'
make[1]: *** [iocs.install] Error 2
make[1]: Leaving directory `C:/Epics/support/areaDetector-2-4/ADExample'
make: *** [C:\Epics\support\areaDetector-2-4/ADExample.install] Error 2

To get it to compile and the plugin to work with the simDetector, I am manually copying the opencv_world310.lib file in the $(ADExample)/lib/$(EPICS_HOST_ARCH) directory.

my CONFIG_SITE.local has opencv location defined as:
OPENCV          = C:/opencv-3.1
OPENCV_LIB      = $(OPENCV)/build/x64/vc12/lib
OPENCV_INCLUDE  = -I$(OPENCV)/build/include/

and the commonDriverMakefile has the following defined:
ifdef ADPLUGINEDGE
  PROD_LIBS             += NDPluginEdge
  $(PROD_NAME)_DBD      += NDPluginEdge.dbd
  ifdef OPENCV_LIB
    opencv_core_DIR     += $(OPENCV_LIB)
    PROD_LIBS           += opencv_world310
  else
    PROD_SYS_LIBS       += opencv_world310
  endif
endif

Is there something else I need to add/change to get it to compile properly?

Thanks

Best,
Ali







References:
compile error in ADExample/simDetector with opencv Alireza Panna
Re: compile error in ADExample/simDetector with opencv Mark Rivers
Re: compile error in ADExample/simDetector with opencv Alireza Panna
Re: compile error in ADExample/simDetector with opencv Mark Rivers
Re: compile error in ADExample/simDetector with opencv Alireza Panna
Re: compile error in ADExample/simDetector with opencv Johnson, Andrew N.
Re: compile error in ADExample/simDetector with opencv Alireza Panna

Navigate by Date:
Prev: Re: compile error in ADExample/simDetector with opencv Alireza Panna
Next: Compile Matlab CA client on 64bit Windows 7? Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: compile error in ADExample/simDetector with opencv Alireza Panna
Next: Job openings for software engineer position at FRIB/MSU Shen, Guobao
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 04 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·