[petsc-users] BuildSystem looks for libOpenCL.a

David Andrs andrsd at gmail.com
Tue Jun 25 17:55:41 CDT 2024


I spotted the problem. There is no libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ > in /usr/lib/x86_64-linux-gnu, only .so.1 and .so.1.0.0. That’s why OpenCL is not found. I have to point the build system to /usr/local/cuda-12.5/targets/x86_64-linux/lib/ which actually has .so.

Thanks for your time and help,

David

> On Jun 25, 2024, at 16:38, David Andrs <andrsd at gmail.com> wrote:
> 
> 
>> On Jun 25, 2024, at 16:19, Barry Smith <bsmith at petsc.dev> wrote:
>> 
>> 
>>    Did you have a problem with the install? 
> 
> Yes. See below.
> 
>> 
>>    Are you concerned with self.liblist          = [['libOpenCL.a'], ['-framework opencl'], ['libOpenCL.lib']]   ?
> 
> Yes.
> 
>> 
>>    Even though only the .a library is listed that should be a stand-in for both the static and shared library and it should automatically find the shared library for you.
> 
> I used `--with-opencl=1` and it did not find the .so. The complete configure line I used:
> 
> ./configure --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3 --FOPTFLAGS=-O3 --with-debugging=0 --with-64-bit-indices --with-yaml=0 --with-hdf5=1 --with-hwloc=0 --with-mpi=1 --with-pthread=1 --with-shared-libraries --with-ssl=0 --with-scalapack=1 --with-exodusii=1 --with-netcdf=1 --with-pnetcdf=1 --download-ptscotch --with-metis=1 --with-parmetis=1 --with-hypre=1 --with-zlib=1 --with-x=0 --with-pic=1 --with-viennacl=1 --with-viennacl-dir=/home/andrsd/usr --prefix=/home/andrsd/usr --with-metis-dir=/home/andrsd/usr --with-hdf5-dir=/home/andrsd/usr --with-hypre-dir=/home/andrsd/usr --with-pnetcdf-dir=/home/andrsd/usr --with-blas-lib=blas --with-lapack-lib=lapack --with-scalapack-dir=/home/andrsd/usr --with-opencl=1
> 
> Attached is a configure.log.
> 
> David
> 
> <configure.tar.gz>
> 
>> 
>>    Barry
>> 
>> 
>>> On Jun 25, 2024, at 6:10 PM, David Andrs <andrsd at gmail.com> wrote:
>>> 
>>> This Message Is From an External Sender 
>>> This message came from outside your organization.
>>> Hello!
>>> 
>>> Is there a reason why the PETSc build system looks for libOpenCL.a, but not for libOpenCL.so <https://urldefense.us/v3/__http://libOpenCL.so__;!!G_uCfscf7eWS!aUphnoqlYDmqiqau_zLjz7XYVRCrIS7jxMEPFgTLd1sLr9q23CNw_4oCjg_wtfFJ9P9SzlfKpcPjVmRbGNc$> on linux platforms? I have a machine with debian 12.5 and nvidia card. It has these packages installed:
>>> 
>>> cuda-opencl-12-5/unknown,now 12.5.39-1 amd64 [installed,automatic]
>>> cuda-opencl-dev-12-5/unknown,now 12.5.39-1 amd64 [installed,automatic]
>>> nvidia-libopencl1/unknown,now 555.42.02-1 amd64 [installed,automatic]
>>> nvidia-opencl-common/unknown,now 555.42.02-1 amd64 [installed,automatic]
>>> nvidia-opencl-icd/unknown,now 555.42.02-1 amd64 [installed,automatic]
>>> opencl-c-headers/stable,now 3.0~2023.02.06-1 all [installed,automatic]
>>> opencl-clhpp-headers/stable,now 3.0~2023.02.06-1 all [installed,automatic]
>>> opencl-headers/stable,now 3.0~2023.02.06-1 all [installed]
>>> 
>>> It only has .so, but no .a
>>> 
>>> $ find /usr -iname 'libopencl*'
>>> /usr/local/cuda-12.5/targets/x86_64-linux/lib/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >.1.0.0
>>> /usr/local/cuda-12.5/targets/x86_64-linux/lib/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >.1
>>> /usr/local/cuda-12.5/targets/x86_64-linux/lib/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >
>>> /usr/local/cuda-12.5/targets/x86_64-linux/lib/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >.1.0
>>> /usr/lib/x86_64-linux-gnu/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >.1.0.0
>>> /usr/lib/x86_64-linux-gnu/libOpenCL.so <https://urldefense.us/v3/__http://libopencl.so/__;!!G_uCfscf7eWS!daLyRLfIoJiq463Jf7F79sQMOSBEeoZ2S2iw3xtMwf1mr2gSQKNi0fpEK-Uw5GN-lZjBMLnsafUN18NggW0$ >.1
>>> 
>>> Are users supposed to use `--with-opencl-include=` and `--with-opencl-lib` switches in this case?
>>> 
>>> Thanks,
>>> 
>>> David
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240625/1460dafb/attachment-0001.html>


More information about the petsc-users mailing list