Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Re: Re:SYCL build for GROMACS

Ducki
Beginner
1,703 Views

I've already installed DPC++/ C++ Intel® oneAPI compiler and MKL library. However, even though i set environment variables by running the command:
source /opt/intel/oneapi/setvars.sh
It appeared as below:
:: initializing oneAPI environment ...
-bash: BASH_VERSION = 5.1.16(1)-release
args: Using "$@" for setvars.sh arguments:
:: compiler -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: mkl -- latest
:: tbb -- latest
:: oneAPI environment initialized ::

And the problem is, whenever i run: "cmake ..  -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx", it cannot find the icx and icpx file, tough these files are still working well:
~$ icx --version
Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230721)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2023.2.1/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2023.2.1/linux/bin-llvm/../bin/icx.cfg

icpx --version
Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230721)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2023.2.1/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2023.2.1/linux/bin-llvm/../bin/icpx.cfg.

So everytime I run the cmake command, i have to type the directory of these files. 
My second problem is when I tried to build SYCL with CMake for GROMACS, the problem came up as:
"CMake Error at cmake/gmxManageSYCL.cmake:384 (message):
Cannot compile a SYCL program with -fsycl. Try a different compiler or
disable SYCL.
Call Stack (most recent call first):
CMakeLists.txt:663 (include)"

Here is my command in Ubuntu 22.04 and the full details for what happened:

~/gromacs-2023.2/build$ sudo cmake .. -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=SYCL -DGMX_SYCL_DEVICE=INTEL -DCMAKE
_C_COMPILER=/opt/intel/oneapi/compiler/2023.2.1/linux/bin/icx -DCMAKE_CXX_COMPILER=/opt/intel/oneapi/compiler/2023.2.1/l
inux/bin/icpx -DGMX_SYCL=ON


-- The C compiler identification is IntelLLVM 2023.2.0
-- The CXX compiler identification is IntelLLVM 2023.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/intel/oneapi/compiler/2023.2.1/linux/bin/icx - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2023.2.1/linux/bin/icpx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CXX17_COMPILES_SIMPLY
-- Performing Test CXX17_COMPILES_SIMPLY - Success
-- Found Python3: /usr/bin/python3.10 (found suitable version "3.10.12", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- Selected GPU FFT library - MKL
-- Found OpenMP_C: -fiopenmp (found version "5.0")
-- Found OpenMP_CXX: -fiopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CXXFLAGS_WARN_NO_RESERVED_IDENTIFIER
-- Performing Test CXXFLAGS_WARN_NO_RESERVED_IDENTIFIER - Success
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CXXFLAGS_NO_UNROLL_WARNING
-- Performing Test CXXFLAGS_NO_UNROLL_WARNING - Success
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file io.h
-- Looking for include file io.h - not found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file xmmintrin.h
-- Looking for include file xmmintrin.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for nice
-- Looking for nice - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for _fileno
-- Looking for _fileno - not found
-- Looking for fileno
-- Looking for fileno - found
-- Looking for _commit
-- Looking for _commit - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Performing Test HAVE_BUILTIN_CLZ
-- Performing Test HAVE_BUILTIN_CLZ - Success
-- Performing Test HAVE_BUILTIN_CLZLL
-- Performing Test HAVE_BUILTIN_CLZLL - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for feenableexcept in m
-- Looking for feenableexcept in m - found
-- Looking for fedisableexcept in m
-- Looking for fedisableexcept in m - found
-- Checking for sched.h GNU affinity API
-- Performing Test sched_affinity_compile
-- Performing Test sched_affinity_compile - Success
-- Looking for include file mm_malloc.h
-- Looking for include file mm_malloc.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Checking for _mm_malloc()
-- Checking for _mm_malloc() - supported
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for memalign
-- Looking for memalign - not found
-- GROMACS is being built without library MPI support (-DGMX_MPI=no). However MPI is potentially useful for the gmxapi Python API, so we will search for MPI anyway. If this causes problems, disable the check with -DCMAKE_DISABLE_FIND_PACKAGE_MPI=on.
-- Could NOT find MPI_C (missing: MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
-- Using default binary suffix: ""
-- Using default library suffix: ""
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test TEST_ATOMICS
-- Performing Test TEST_ATOMICS - Success
-- Atomic operations found
-- Performing Test PTHREAD_SETAFFINITY
-- Performing Test PTHREAD_SETAFFINITY - Success
-- Detecting best SIMD instructions for this CPU
-- Checking for GCC x86 inline asm
-- Checking for GCC x86 inline asm - supported
-- Detected build CPU features - aes apic avx avx2 clfsh cmov cx8 cx16 f16c fma htt intel lahf mmx msr nonstop_tsc pcid pclmuldq pdcm pdpe1gb popcnt pse rdrnd rdtscp sha sse2 sse3 sse4.1 sse4.2 ssse3 tdt x2apic
-- Detected build CPU brand - 12th Gen Intel(R) Core(TM) i5-1240P
-- Detected best SIMD instructions for this CPU - AVX2_256
-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED - Success
-- Performing Test C_mavx2_mfma_COMPILE_WORKS
-- Performing Test C_mavx2_mfma_COMPILE_WORKS - Success
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED - Success
-- Performing Test CXX_mavx2_mfma_COMPILE_WORKS
-- Performing Test CXX_mavx2_mfma_COMPILE_WORKS - Success
-- Enabling 256-bit AVX2 SIMD instructions using CXX flags: -mavx2 -mfma
-- Detecting flags to enable runtime detection of AVX-512 units on newer CPUs
-- Performing Test C_xCORE_AVX512_qopt_zmm_usage_high_FLAG_ACCEPTED
-- Performing Test C_xCORE_AVX512_qopt_zmm_usage_high_FLAG_ACCEPTED - Success
-- Performing Test C_xCORE_AVX512_qopt_zmm_usage_high_COMPILE_WORKS
-- Performing Test C_xCORE_AVX512_qopt_zmm_usage_high_COMPILE_WORKS - Success
-- Performing Test CXX_xCORE_AVX512_qopt_zmm_usage_high_FLAG_ACCEPTED
-- Performing Test CXX_xCORE_AVX512_qopt_zmm_usage_high_FLAG_ACCEPTED - Success
-- Performing Test CXX_xCORE_AVX512_qopt_zmm_usage_high_COMPILE_WORKS
-- Performing Test CXX_xCORE_AVX512_qopt_zmm_usage_high_COMPILE_WORKS - Success
-- Detecting flags to enable runtime detection of AVX-512 units on newer CPUs - -xCORE-AVX512 -qopt-zmm-usage=high
-- Performing Test _Wno_unused_command_line_argument_FLAG_ACCEPTED
-- Performing Test _Wno_unused_command_line_argument_FLAG_ACCEPTED - Success
-- Performing Test _callconv___vectorcall
-- Performing Test _callconv___vectorcall - Success
-- Checking for flags to enable SYCL
-- Performing Test SYCL_CXX_FLAGS_RESULT
-- Performing Test SYCL_CXX_FLAGS_RESULT - Failed
CMake Error at cmake/gmxManageSYCL.cmake:384 (message):
Cannot compile a SYCL program with -fsycl. Try a different compiler or
disable SYCL.
Call Stack (most recent call first):
CMakeLists.txt:663 (include)


-- Configuring incomplete, errors occurred!

 

Please help me to sort it out, I really need this for my works. Thanks in advance!

 

0 Kudos
1 Solution
SeshaP_Intel
Moderator
1,669 Views

Hi,

 

Thank you for posting in Intel Communities.

 

>> And the problem is, whenever i run: "cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx", it cannot find the icx and icpx file, tough these files are still working well:

 

On the Ubuntu 22.04 system, I have installed the latest Intel oneAPI DPC++/C++ Compiler, Math Kernel Library (oneMKL), and run the below command. 

source /opt/intel/oneapi/setvars.sh
cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx

 

We did not face any issues with icx/icpx. Please find the below screenshot for more details.

SeshaP_Intel_0-1694695989281.png

 

>> My second problem is when I tried to build SYCL with CMake for GROMACS, the problem came up as:

"CMake Error at cmake/gmxManageSYCL.cmake:384 (message):

Cannot compile a SYCL program with -fsycl. Try a different compiler or

disable SYCL.

Call Stack (most recent call first):

CMakeLists.txt:663 (include)"

 

We are not able to see this error when we remove the sudo in your command. Please find the below screenshot for more details.

SeshaP_Intel_1-1694696032909.png

Could you please try building the GROMACS with CMake without using sudo and let us know the results?

Please let us know if you still face any issues.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

View solution in original post

0 Kudos
3 Replies
SeshaP_Intel
Moderator
1,670 Views

Hi,

 

Thank you for posting in Intel Communities.

 

>> And the problem is, whenever i run: "cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx", it cannot find the icx and icpx file, tough these files are still working well:

 

On the Ubuntu 22.04 system, I have installed the latest Intel oneAPI DPC++/C++ Compiler, Math Kernel Library (oneMKL), and run the below command. 

source /opt/intel/oneapi/setvars.sh
cmake .. -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx

 

We did not face any issues with icx/icpx. Please find the below screenshot for more details.

SeshaP_Intel_0-1694695989281.png

 

>> My second problem is when I tried to build SYCL with CMake for GROMACS, the problem came up as:

"CMake Error at cmake/gmxManageSYCL.cmake:384 (message):

Cannot compile a SYCL program with -fsycl. Try a different compiler or

disable SYCL.

Call Stack (most recent call first):

CMakeLists.txt:663 (include)"

 

We are not able to see this error when we remove the sudo in your command. Please find the below screenshot for more details.

SeshaP_Intel_1-1694696032909.png

Could you please try building the GROMACS with CMake without using sudo and let us know the results?

Please let us know if you still face any issues.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
Ducki
Beginner
1,638 Views

Thank you very much, I finally solved the problem thanks to your help. I didn't know that using sudo can cause problems, as I did install GROMACS successfully before with sudo (but without SYCL programming) since GROMACS building folder requires root user permissions. Anyway, I really appreciate your enthusiasm.

 

Best regards.

0 Kudos
SeshaP_Intel
Moderator
1,561 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Reply