Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to compile Autodock-GPU on Windows? #221

Open
kotenok2000 opened this issue Mar 1, 2023 · 4 comments
Open

Is there a way to compile Autodock-GPU on Windows? #221

kotenok2000 opened this issue Mar 1, 2023 · 4 comments

Comments

@kotenok2000
Copy link

I tried to compile it in cygwin and mingw.
I got these errors

make DEVICE=OCLGPU NUMWI=64
rm -f ./host/inc/performdocking.h ./host/src/performdocking.cpp
Building adgpu_analysis ...
g++
./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp
-std=c++11 -I./common -I./host/inc -DVERSION="v1.5.3"
-o./bin/adgpu_analysis
-O3 -DTOOLMODE
./host/src/getparameters.cpp: В функции «int parse_dpf(Dockpars*, Gridinfo*, FileList&, bool)»:
./host/src/getparameters.cpp:186:78: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
186 | mypars->ligandfile = strdup(argstr);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:193:79: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
193 | mypars->flexresfile = strdup(argstr);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:201:75: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
201 | mypars->fldfile = strdup(argstr); // this allows using the dpf to set up all parameters but the ligand
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:384:90: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
384 | } else mypars->resname = strdup("docking"); // Fallback to old default
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:395:101: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
395 | mypars->flexresfile=strdup(mypars->flexresfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:398:104: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
398 | mypars->xrayligandfile=strdup(mypars->xrayligandfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp: В функции «int initial_commandpars(const int*, char**, Dockpars*, Gridinfo*, FileList&)»:
./host/src/getparameters.cpp:610:43: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
610 | mypars->dpffile = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:621:44: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
621 | mypars->load_xml = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:698:44: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
698 | mypars->load_xml = strdup(xml_files[i].c_str());
| ^~~~~~
| strcmp
./host/src/getparameters.cpp: В функции «int get_filelist(const int*, char**, Dockpars*, Gridinfo*, FileList&)»:
./host/src/getparameters.cpp:832:57: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
832 | mypars->fldfile=strdup(mypars->fldfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:835:61: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
835 | mypars->flexresfile=strdup(mypars->flexresfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:838:64: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
838 | mypars->xrayligandfile=strdup(mypars->xrayligandfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:840:46: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
840 | mypars->ligandfile = strdup(ligands[i]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:862:58: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
862 | } else if(ligands.size()==1) filelist.filename = strdup(ligands[0]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:907:51: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
907 | mypars->fldfile = strdup(filelist.fld_files.back().name.c_str());
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:918:58: ошибка: «strndup» was not declared in this scope; did you mean «strncmp»?
918 | mypars->xrayligandfile = strndup(line.c_str(),len-1);
| ^~~~~~~
| strncmp
./host/src/getparameters.cpp:929:65: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
929 | mypars->fldfile=strdup(mypars->fldfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:932:69: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
932 | mypars->flexresfile=strdup(mypars->flexresfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:935:72: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
935 | mypars->xrayligandfile=strdup(mypars->xrayligandfile);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:979:57: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
979 | filelist.mypars[i].ligandfile = strdup(filelist.ligand_files[i].c_str());
| ^~~~~~
| strcmp
./host/src/getparameters.cpp: В функции «int get_filenames_and_ADcoeffs(const int*, char**, Dockpars*, bool, bool)»:
./host/src/getparameters.cpp:1026:51: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1026 | mypars->fldfile = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1033:54: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1033 | mypars->ligandfile = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1040:47: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1040 | mypars->flexresfile = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp: В функции «int get_commandpars(const int*, char**, double*, Dockpars*, bool)»:
./host/src/getparameters.cpp:1224:55: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1224 | mypars->xrayligandfile = strdup(mypars->ligandfile); // By default xray-ligand file is the same as the randomized input ligand
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1231:71: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1231 | } else if(!mypars->resname) mypars->resname = strdup("docking"); // Fallback to old default
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1239:58: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1239 | } else mypars->resname = strdup("docking"); // Fallback to old default
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1437:38: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1437 | char* temp = strdup(argv [i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1577:44: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1577 | mypars->load_xml = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1847:43: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1847 | mypars->resname = strdup(argv [i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:1930:50: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
1930 | mypars->xrayligandfile = strdup(argv[i+1]);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp: В функции «void read_xml_filenames(char*, char*&, char*&, char*&, char*&, unsigned int&, uint32_t*)»:
./host/src/getparameters.cpp:2146:61: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
2146 | if(dpf_filename==NULL) dpf_filename=strdup(tmpstr);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:2153:63: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
2153 | if(grid_filename==NULL) grid_filename=strdup(tmpstr);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:2161:67: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
2161 | if(ligand_filename==NULL) ligand_filename=strdup(tmpstr);
| ^~~~~~
| strcmp
./host/src/getparameters.cpp:2169:69: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
2169 | if(flexres_filename==NULL) flexres_filename=strdup(tmpstr);
| ^~~~~~
| strcmp
./host/src/miscellaneous.cpp: В функции «std::string get_filepath(const char*)»:
./host/src/miscellaneous.cpp:263:21: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
263 | char* ts1 = strdup(filename);
| ^~~~~~
| strcmp
./host/src/setup.cpp: В функции «int setup(Gridinfo*, Dockpars*, Liganddata&, Liganddata&, FileList&, int, int, char**)»:
./host/src/setup.cpp:350:32: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
350 | orig_resname = strdup(mypars->resname); // need to copy it since it might get free'd in the next line
| ^~~~~~
| strcmp
./host/src/setup.cpp:352:32: ошибка: «strdup» was not declared in this scope; did you mean «strcmp»?
352 | orig_resname = strdup(""); // need an empty string for later if no resname has been specified
| ^~~~~~
| strcmp
make: *** [Makefile.OpenCL:259: otool] Error 1

@kotenok2000
Copy link
Author

When i removed -std=c++11 i got this error.

make DEVICE=OCLGPU NUMWI=64
rm -f ./host/inc/performdocking.h ./host/src/performdocking.cpp
Building adgpu_analysis ...
g++
./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp
-I./common -I./host/inc -DVERSION="v1.5.3-dirty"
-o./bin/adgpu_analysis
-O3 -DTOOLMODE
DEVICE is set to GPU

CPU_INCLUDE_PATH is undefined
CPU_LIBRARY_PATH is undefined

GPU_INCLUDE_PATH is set to /cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/include/
GPU_LIBRARY_PATH is set to /cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/lib/x64/

./stringify_ocl_krnls.sh

Stringified input header files:
./common/defines.h
./common/calcenergy_basic.h

Stringified input non-kernel files:
./device/auxiliary_genetic.cl
./device/calcenergy.cl
./device/calcgradient.cl
./device/calcMergedEneGra.cl

Stringified input kernel-files:
./device/kernel1.cl
./device/kernel2.cl
./device/kernel4.cl
./device/kernel3.cl
./device/kernel_sd.cl
./device/kernel_fire.cl
./device/kernel_ad.cl

Stringified output file:
host/inc/stringify.h

ln -sf performdocking.h.OpenCL ./host/inc/performdocking.h
ln -sf performdocking.cpp.OpenCL ./host/src/performdocking.cpp
Building autodock_gpu_64wi ...
g++
./wrapcl/src/BufferObjects.cpp ./wrapcl/src/CommandQueues.cpp ./wrapcl/src/Contexts.cpp ./wrapcl/src/Devices.cpp ./wrapcl/src/ImportBinary.cpp ./wrapcl/src/ImportSource.cpp ./wrapcl/src/Kernels.cpp ./wrapcl/src/listAttributes.cpp ./wrapcl/src/Platforms.cpp ./wrapcl/src/Programs.cpp ./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/performdocking.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp
-I./common -I./wrapcl/inc -I./host/inc -I./device -I/cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/include/ -L/cygdrive/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/lib/x64/ -DVERSION="v1.5.3-dirty"
-lOpenCL
-o./bin/autodock_gpu_64wi
-DGPU_DEVICE -DN64WI -O3 -DKRNL_SOURCE=./device/calcenergy.cl -DKRNL_DIRECTORY=./device -DKCMN_DIRECTORY=./common -DK1="gpu_calc_initpop" -DK2="gpu_sum_evals" -DK3="perform_LS" -DK4="gpu_gen_and_eval_newpops" -DK5="gradient_minSD" -DK6="gradient_minFire" -DK7="gradient_minAD"
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: внутренняя ошибка: останов на /mnt/share/cygpkgs/binutils/binutils.x86_64/src/binutils-2.40/ld/ldlang.c:527 в compare_section
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: сообщите об этой ошибке
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
make: *** [Makefile.OpenCL:267: odock] Error 1

@atillack
Copy link
Member

@kotenok2000 Please try replacing -std=c++11 with -std=gnu++11.

@kotenok2000
Copy link
Author

It fails like this:
make DEVICE=OCLGPU NUMWI=64
rm -f ./host/inc/performdocking.h ./host/src/performdocking.cpp
Building adgpu_analysis ...
g++
./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp
-std=gnu++11 -I./common -I./host/inc -DVERSION="v1.5.3-48-gf9ea8ba79f3cf73a7873357f949a0043c524ca2b-dirty"
-o./bin/adgpu_analysis
-O3 -DTOOLMODE
DEVICE is set to GPU

CPU_INCLUDE_PATH is undefined
CPU_LIBRARY_PATH is undefined

GPU_INCLUDE_PATH is set to /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/include/
GPU_LIBRARY_PATH is set to /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/lib/x64/

./stringify_ocl_krnls.sh

Stringified input header files:
./common/defines.h
./common/calcenergy_basic.h

Stringified input non-kernel files:
./device/auxiliary_genetic.cl
./device/calcenergy.cl
./device/calcgradient.cl
./device/calcMergedEneGra.cl

Stringified input kernel-files:
./device/kernel1.cl
./device/kernel2.cl
./device/kernel4.cl
./device/kernel3.cl
./device/kernel_sd.cl
./device/kernel_fire.cl
./device/kernel_ad.cl

Stringified output file:
host/inc/stringify.h

ln -sf performdocking.h.OpenCL ./host/inc/performdocking.h
ln -sf performdocking.cpp.OpenCL ./host/src/performdocking.cpp
Building autodock_gpu_64wi ...
g++
./wrapcl/src/BufferObjects.cpp ./wrapcl/src/CommandQueues.cpp ./wrapcl/src/Contexts.cpp ./wrapcl/src/Devices.cpp ./wrapcl/src/ImportBinary.cpp ./wrapcl/src/ImportSource.cpp ./wrapcl/src/Kernels.cpp ./wrapcl/src/Platforms.cpp ./wrapcl/src/Programs.cpp ./wrapcl/src/listAttributes.cpp ./host/src/calcenergy.cpp ./host/src/getparameters.cpp ./host/src/main.cpp ./host/src/miscellaneous.cpp ./host/src/performdocking.cpp ./host/src/processgrid.cpp ./host/src/processligand.cpp ./host/src/processresult.cpp ./host/src/setup.cpp
-std=gnu++11 -I./common -I./wrapcl/inc -I./host/inc -I./device -I/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/include/ -L/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v12.0/lib/x64/ -DVERSION="v1.5.3-48-gf9ea8ba79f3cf73a7873357f949a0043c524ca2b-dirty"
-lOpenCL
-o./bin/autodock_gpu_64wi
-DGPU_DEVICE -DN64WI -O3 -DKRNL_SOURCE=./device/calcenergy.cl -DKRNL_DIRECTORY=./device -DKCMN_DIRECTORY=./common -DK1="gpu_calc_initpop" -DK2="gpu_sum_evals" -DK3="perform_LS" -DK4="gpu_gen_and_eval_newpops" -DK5="gradient_minSD" -DK6="gradient_minFire" -DK7="gradient_minAD"
/usr/lib/gcc/x86_64-pc-msys/11.3.0/../../../../x86_64-pc-msys/bin/ld: internal error: aborting at ../../binutils-2.40/ld/ldlang.c:527 in compare_section
/usr/lib/gcc/x86_64-pc-msys/11.3.0/../../../../x86_64-pc-msys/bin/ld: please report this bug
collect2: error: ld returned 1 exit status
make: *** [Makefile.OpenCL:267: odock] Error 1

@atillack
Copy link
Member

@kotenok2000 We will have a new release that supports Windows with OpenCL natively soon (code just merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants