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: Wed, 3 Aug 2016 22:15:30 -0400
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






Replies:
Re: compile error in ADExample/simDetector with opencv Alireza Panna
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.

Navigate by Date:
Prev: Re: compile error in ADExample/simDetector with opencv Johnson, Andrew N.
Next: Re: compile error in ADExample/simDetector with opencv Alireza Panna
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 Johnson, Andrew N.
Next: Re: compile error in ADExample/simDetector with opencv Alireza Panna
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, 03 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·