Hi,
In other situations I have seen DLL load errors caused by a dependency of the DLL in question not being found i.e. ARC_Instrument_x64.dll may be present in the right place but one of
the DLLs it depends on (and is located via the PATH environment variable) might be either not found or an old/incorrect version of this required file was installed by another program which happens to be earlier in PATH and so is picked up instead. Programs
like dependency walker https://www.dependencywalker.com/ can help locate such clashes if that is the problem
Regards,
Freddie
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Mark Rivers via Tech-talk
Sent: 27 March 2023 23:21
To: William Kirstaedter <kirstaedter at fhi-berlin.mpg.de>; tech-talk <tech-talk at aps.anl.gov>
Subject: RE: areadetector on windows, xml2 done, now Lightfield
Hi William,
I am trying to understand why you get that missing DLL error.
Can run the camera OK using LightField as a stand-alone application without EPICS?
Do you have more than one version of LightField installed?
ADLightField does not call that DLL explicitly, it just starts LightField in this line:
https://github.com/areaDetector/ADLightField/blob/3383118260b82d95255f303d673e04d4de0123c9/lightFieldApp/src/LightField.cpp#L410
The missing DLL is ARC_Instrument_x64.dll. I have attached a screen shot showing the size and location of that file on my system. What do you see on your system?
Mark
Hi Mark,
Heres mine:
(no phoebus screenshot since my IOC doesn't start properly because of the error)
Environment: LIGHTFIELD_ROOT exists and is set correctly.
and PATH:
have Lightfield 6.14
AD is master branch everywhere.
I also noticed that the ddlPath.bat clobbers the PATH with each IOC boot until windows complains that the PATH is too long.
(this of course only happens if you launch the .bat from commandline, if launched via double-click its fine)
I'd suggest a change in dllPath.bat:
REM only extend PATH if
not already done. save original path in _OLDPATH
IF
"%_OLDPATH%"==""
SET
"_OLDPATH=%PATH%"
REM first, restore original
PATH
SET
"PATH=S:\TUFF\EPICS;P:\UTS\HERE"
Thanks,
Am 27.03.2023 um 15:03 schrieb Mark Rivers:
Hi William,
I just checked one of our systems which is running ADLightField. I have attached 3 screens shots:
Lightfield.png This is the medm screen for ADLightField. It shows we are running 6.4.1 of the Princeton SDK, and 2.6.0 of ADLightField.
ENVIRONMENT.png This shows all of the system environment variables. Note the value of LIGHTFIELD_ROOT.
PATH.png This shows all of the entries in the PATH environment variable. Note the two entries for Princeton Instruments.
How do these compare to your system?
Mark
What version of LightField are you running?
What version of ADLightField are you running?
From: William Kirstaedter
Sent: Monday, March 27, 2023 6:26 AM
To: Mark Rivers; tech-talk
Subject: Re: areadetector on windows, xml2 done, now Lightfield
I would like to warm that up again.
I want to use areaDetector with / for Lightfield, and I run into the following problem:
System.TypeInitializationException: The type initializer for 'PIActon.ExperimentControl.DeviceManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'PIActon.SpectralDevices.DeviceManager'
threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'ARC_Instrument_x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at PIActon.Interop.Arc.Utility.ARC_Ver(Int32& Major, Int32& Minor, Int32& Build)
at PIActon.SpectralDevices.Version.ExecuteRequest()
at PIActon.SpectralDevices.Builder.init()
at PIActon.SpectralDevices.DeviceManager..ctor()
at PIActon.SpectralDevices.DeviceManager..cctor()
--- End of inner exception stack trace ---
at PIActon.ExperimentControl.DeviceManager..cctor()
--- End of inner exception stack trace ---
at PIActon.ExperimentControl.DeviceManager.Instance()
at PrincetonInstruments.Monarch.UISystemManager.Initialize()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
any advice on that?
putting the mentioned .dll into the bin/windows-x64 folder alongside the IOC's .exe or into ADLightfield\bin\windows-x64 doesnt help unfortunately.
Thanks!
Am 10.03.2023 um 17:17 schrieb William Kirstaedter via Tech-talk:
Hi Mark,
thanks for pointing it out. I guess, RTFM for me ;)
Nevertheless, I'd suggest moving that section of the manual to the top, so the interested one can directly see what is required to build areaDetector from source.
Also, I'd suggest a copyFromExample.bat. (with COPY /Y instead of cp)
FYI, I copied
C:\EPICS\epics-support\areaDetector\configure>copy EXAMPLE_RELEASE.local RELEASE.local
C:\EPICS\epics-support\areaDetector\configure>copy EXAMPLE_RELEASE_LIBS.local RELEASE_LIBS.local
C:\EPICS\epics-support\areaDetector\configure>copy EXAMPLE_RELEASE_PRODS.local RELEASE_PRODS.local
C:\EPICS\epics-support\areaDetector\configure>copy EXAMPLE_CONFIG_SITE.local.WIN32 CONFIG_SITE.local.WIN32
and I specified AREA_DETECTOR=$(SUPPORT)/areaDetector in my $(SUPPORT)/RELEASE.local file.
then areaDetector compiled from the TOP directory.
thanks for the help!
Am 09.03.2023 um 20:17 schrieb Mark Rivers:
Hi William,
I just tested building xml2Src and it worked fine for me.
This is an abbreviated version of the build output.
*************************************
J:\epics\devel\areaDetector\ADSupport\supportApp\xml2Src>make clean
perl -CSD -MExtUtils::Command -e rm_rf O.windows-x64 O.Common
J:\epics\devel\areaDetector\ADSupport\supportApp\xml2Src>make
perl -CSD H:/epics-devel/base-7.0.7/bin/windows-x64/makeMakefile.pl O.windows-x64 ../../..
perl -CSD -MExtUtils::Command -e mkpath O.Common
make -C O.windows-x64 -f ../Makefile TOP=../../.. \
T_A=windows-x64 install
make[1]: Entering directory 'J:/epics/devel/areaDetector/ADSupport/supportApp/xml2Src/O.windows-x64'
perl -CSD H:/epics-devel/base-7.0.7/bin/windows-x64/mkmf.pl -m nanohttp_stream.d -I. -I../O.Common -I. -I. -I../os/WIN32 -I../os/default -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32 -I../../../include
-IJ:/epics/devel/asyn-4-43/include -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include/os/WIN32 -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include -IJ:/epics/devel/areaDetector-3-12-1/ADCore/include -IH:/epics-devel/base-7.0.7/include/compiler/msvc
-IH:/epics-devel/base-7.0.7/include/os/WIN32 -IH:/epics-devel/base-7.0.7/include nanohttp_stream.obj ../nanohttp_stream.c
perl -CSD H:/epics-devel/base-7.0.7/bin/windows-x64/mkmf.pl -m xmlstring.d -I. -I../O.Common -I. -I. -I../os/WIN32 -I../os/default -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32 -I../../../include
-IJ:/epics/devel/asyn-4-43/include -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include/os/WIN32 -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include -IJ:/epics/devel/areaDetector-3-12-1/ADCore/include -IH:/epics-devel/base-7.0.7/include/compiler/msvc
-IH:/epics-devel/base-7.0.7/include/os/WIN32 -IH:/epics-devel/base-7.0.7/include xmlstring.obj ../xmlstring.c
…
cl -nologo -FC -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -GL -Oy- -W3 -DPIC -DNOLIBTOOL -DHAVE_ZLIB_H -DWIN32 -MD -DEPICS_BUILD_DLL -DEPICS_CALL_DLL -I. -I../O.Common
-I. -I. -I../os/WIN32 -I../os/default -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32 -I../../../include -IJ:/epics/devel/asyn-4-43/include -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include/os/WIN32 -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include
-IJ:/epics/devel/areaDetector-3-12-1/ADCore/include -IH:/epics-devel/base-7.0.7/include/compiler/msvc -IH:/epics-devel/base-7.0.7/include/os/WIN32 -IH:/epics-devel/base-7.0.7/include -c ../catalog.c
catalog.c
…
link -nologo -subsystem:windows -dll -LTCG -incremental:no -opt:ref -release -MACHINE:X64 -out:xml2.dll -implib:xml2.lib buf.obj c14n.obj catalog.obj chvalid.obj debugXML.obj dict.obj DOCBparser.obj encoding.obj
entities.obj error.obj globals.obj hash.obj HTMLparser.obj HTMLtree.obj legacy.obj list.obj nanoftp.obj nanohttp.obj parser.obj parserInternals.obj pattern.obj relaxng.obj SAX2.obj SAX.obj schematron.obj threads.obj tree.obj uri.obj valid.obj xinclude.obj
xlink.obj xmlIO.obj xmlmemory.obj xmlreader.obj xmlregexp.obj xmlmodule.obj xmlsave.obj xmlschemas.obj xmlschemastypes.obj xmlunicode.obj xmlwriter.obj xpath.obj xpointer.obj xmlstring.obj ../../../lib/windows-x64/zlib.lib ws2_32.lib
Creating library xml2.lib and object xml2.exp
Generating code
Finished generating code
cl -nologo -FC -D__STDC__=0 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -Ox -GL -Oy- -W3 -DPIC -DNOLIBTOOL -DHAVE_ZLIB_H -DWIN32 -MD -DEPICS_BUILD_DLL -DEPICS_CALL_DLL -I. -I../O.Common
-I. -I. -I../os/WIN32 -I../os/default -I.. -I../../../include/compiler/msvc -I../../../include/os/WIN32 -I../../../include -IJ:/epics/devel/asyn-4-43/include -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include/os/WIN32 -IJ:/epics/devel/areaDetector-3-12-1/ADSupport/include
-IJ:/epics/devel/areaDetector-3-12-1/ADCore/include -IH:/epics-devel/base-7.0.7/include/compiler/msvc -IH:/epics-devel/base-7.0.7/include/os/WIN32 -IH:/epics-devel/base-7.0.7/include -c ../nanohttp_stream.c
nanohttp_stream.c
…
make[1]: Circular xml2.lib <- nanohttp_stream.dll dependency dropped.
"Installing shared library ../../../bin/windows-x64/xml2.dll"
"Installing library ../../../lib/windows-x64/xml2.lib"
link -nologo -subsystem:windows -dll -LTCG -incremental:no -opt:ref -release -MACHINE:X64 -out:nanohttp_stream.dll -implib:nanohttp_stream.lib nanohttp_stream.obj buf.obj c14n.obj catalog.obj chvalid.obj debugXML.obj
dict.obj DOCBparser.obj encoding.obj entities.obj error.obj globals.obj hash.obj HTMLparser.obj HTMLtree.obj legacy.obj list.obj nanoftp.obj nanohttp.obj parser.obj parserInternals.obj pattern.obj relaxng.obj SAX2.obj SAX.obj schematron.obj threads.obj tree.obj
uri.obj valid.obj xinclude.obj xlink.obj xmlIO.obj xmlmemory.obj xmlreader.obj xmlregexp.obj xmlmodule.obj xmlsave.obj xmlschemas.obj xmlschemastypes.obj xmlunicode.obj xmlwriter.obj xpath.obj xpointer.obj xmlstring.obj ../../../lib/windows-x64/xml2.lib
../../../lib/windows-x64/zlib.lib ws2_32.lib
Creating library nanohttp_stream.lib and object nanohttp_stream.exp
Generating code
Finished generating code
"Installing shared library ../../../bin/windows-x64/nanohttp_stream.dll"
"Installing library ../../../lib/windows-x64/nanohttp_stream.lib"
make[1]: Leaving directory 'J:/epics/devel/areaDetector/ADSupport/supportApp/xml2Src/O.windows-x64'
*************************************
Note that it first build xml2.lib and xml2.dll and then built nanohttp.stream.lib and .dll.
The only reason it would not do this is if you have not defined XML2_EXTERNAL=NO.
1.
I haven't configured CONFIG_SITE.local at all - NO seems to be the default. (?)
Did you install CONFIG_SITE.local from EXAMPLE_CONFIG_SITE.local as explained in the InstallGuide?
https://areadetector.github.io/master/install_guide.html#release-and-config-files
I think the behavior you see can only be explained if you don’t have an areaDetector/configure/CONFIG_SITE.local file at all, or if you do have that file but have modified it from EXAMPLE_CONFIG_SITE.local.
EXAMPLE_CONFIG_SITE.local does define XML2_EXTERNAL=NO in this line:
https://github.com/areaDetector/areaDetector/blob/78fae55898b9028e756eb080367cd6aad8913b54/configure/EXAMPLE_CONFIG_SITE.local#L115
Mark
Hi Mark,
1.
Is XML2_EXTERNAL defined to be NO in areaDetector/configure/CONFIG_SITE.local?
I haven't configured CONFIG_SITE.local at all - NO seems to be the default. (?)
1.
Just before you get that error do you see xml2.lib being built? Does it exist in the ADSupport/lib/windows-x64 directory?
no, and no.
thanks for helping :)
Am 07.03.2023 um 13:43 schrieb Mark Rivers:
1.
Is XML2_EXTERNAL defined to be NO in areaDetector/configure/CONFIG_SITE.local?
2.
Just before you get that error do you see xml2.lib being built? Does it exist in the ADSupport/lib/windows-x64 directory?