Skip to content

Add rdkit package#509

Closed
fxcoudert wants to merge 14 commits intopyodide:mainfrom
fxcoudert:rdkit
Closed

Add rdkit package#509
fxcoudert wants to merge 14 commits intopyodide:mainfrom
fxcoudert:rdkit

Conversation

@fxcoudert
Copy link
Copy Markdown

First try for now, it's a complicated process with Boost and Cmake

@fxcoudert
Copy link
Copy Markdown
Author

OK, I have reached the stage where boost-python is successfully installed. I can see:

/home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_python313.a                                                                       
/home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_numpy313.a                                                                        
/home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_container.a                                                                       
/home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_graph.a                                                                           

🎉

Now, to get rdkit to work…

@fxcoudert
Copy link
Copy Markdown
Author

Next issue was: boostorg/boost_install#82
Fixed by passing the right argument to boost build.

@fxcoudert
Copy link
Copy Markdown
Author

fxcoudert commented Mar 4, 2026

Then, I encountered this rdkit issue: rdkit/rdkit#9150
Fixed by hacking the cmake file.

Now I get a problem with the INCHI-API dep, which isn't set up to build static libraries:

2026-03-04T15:43:16.1265127Z [ 36%] Building CXX object                                                      
2026-03-04T15:43:16.1265342Z External/INCHI-API/Wrap/CMakeFiles/rdinchi.dir/pyInchi.cpp.o                    
2026-03-04T15:43:16.1265529Z [ 36%] Linking CXX shared module ../../../rdkit/Chem/rdinchi.so                 
2026-03-04T15:43:16.1265736Z em++: warning: -sSIDE_MODULE + pthreads is experimental [-Wexperimental]        
2026-03-04T15:43:16.1265969Z em++: warning: ignoring unsupported linker flag: `--allow-shlib-undefined`      
2026-03-04T15:43:16.1266112Z [-Wlinkflags]                                                                   
2026-03-04T15:43:16.1266319Z em++: warning: ignoring unsupported linker flag: `-rpath-link` [-Wlinkflags]    
2026-03-04T15:43:16.1266525Z em++: warning: ignoring unsupported linker flag: `--allow-shlib-undefined`      
2026-03-04T15:43:16.1266784Z [-Wlinkflags]                                                                   
2026-03-04T15:43:16.1266984Z em++: warning: ignoring unsupported linker flag: `-rpath-link` [-Wlinkflags]    
2026-03-04T15:43:16.1267177Z cache:INFO: generating system asset:                                            
2026-03-04T15:43:16.1267399Z sysroot/lib/wasm32-emscripten/pic/crtbegin.o... (this will be cached in         
2026-03-04T15:43:16.1267615Z "/home/runner/work/pyodide-recipes/pyodide-recipes/emsdk/upstream/emscripten/cac
2026-03-04T15:43:16.1267830Z he/sysroot/lib/wasm32-emscripten/pic/crtbegin.o" for subsequent builds)         
2026-03-04T15:43:16.1268020Z system_libs:INFO: compiled 1 inputs in 0.16s                                    
2026-03-04T15:43:16.1268173Z cache:INFO:  - ok                                                               
2026-03-04T15:43:16.1268339Z wasm-ld: error: cannot open                                                     
2026-03-04T15:43:16.1268572Z /home/runner/miniconda3/envs/pyodide-env/shared/python_compiler_compat: Is a    
2026-03-04T15:43:16.1268710Z directory                                                                       
2026-03-04T15:43:16.1268849Z em++: error:                                                                    
2026-03-04T15:43:16.1269067Z '/home/runner/work/pyodide-recipes/pyodide-recipes/emsdk/upstream/bin/wasm-ld -o
2026-03-04T15:43:16.1269243Z ../../../rdkit/Chem/rdinchi.so                                                  
2026-03-04T15:43:16.1269459Z /home/runner/miniconda3/envs/pyodide-env/shared/python_compiler_compat -rpath   
2026-03-04T15:43:16.1269661Z /home/runner/miniconda3/envs/pyodide-env/lib                                    
2026-03-04T15:43:16.1269867Z -L/home/runner/miniconda3/envs/pyodide-env/lib -rpath                           
2026-03-04T15:43:16.1270067Z /home/runner/miniconda3/envs/pyodide-env/lib                                    
2026-03-04T15:43:16.1270348Z -L/home/runner/miniconda3/envs/pyodide-env/lib                                  
2026-03-04T15:43:16.1279925Z -L/home/runner/.cache/.pyodide-xbuildenv-0.31.2.dev3+gb82593b9c/https_github_com
2026-03-04T15:43:16.1280231Z _pyodide_pyodide-build-environment-nightly_releases_download_20260201_xbuildenv_
2026-03-04T15:43:16.1280463Z tar_bz2/xbuildenv/pyodide-root/cpython/installs/python-3.13.2/lib/              
2026-03-04T15:43:16.1280696Z -L/home/runner/.cache/.pyodide-xbuildenv-0.31.2.dev3+gb82593b9c/https_github_com
2026-03-04T15:43:16.1280930Z _pyodide_pyodide-build-environment-nightly_releases_download_20260201_xbuildenv_
2026-03-04T15:43:16.1281150Z tar_bz2/xbuildenv/pyodide-root/cpython/installs/python-3.13.2/lib/              
2026-03-04T15:43:16.1281365Z -L/home/runner/.cache/.pyodide-xbuildenv-0.31.2.dev3+gb82593b9c/https_github_com
2026-03-04T15:43:16.1281604Z _pyodide_pyodide-build-environment-nightly_releases_download_20260201_xbuildenv_
2026-03-04T15:43:16.1281818Z tar_bz2/xbuildenv/pyodide-root/cpython/installs/python-3.13.2/lib/              
2026-03-04T15:43:16.1282042Z -L/home/runner/.cache/.pyodide-xbuildenv-0.31.2.dev3+gb82593b9c/https_github_com
2026-03-04T15:43:16.1282395Z _pyodide_pyodide-build-environment-nightly_releases_download_20260201_xbuildenv_
2026-03-04T15:43:16.1282607Z tar_bz2/xbuildenv/pyodide-root/cpython/installs/python-3.13.2/lib/              
2026-03-04T15:43:16.1282822Z CMakeFiles/rdinchi.dir/pyInchi.cpp.o ../../../lib/libRDKitRDInchiLib.a          
2026-03-04T15:43:16.1283016Z ../../../lib/libRDKitRDBoost.a ../../../lib/libRDKitInchi.a                     
2026-03-04T15:43:16.1283206Z ../../../lib/libRDKitDepictor.a ../../../lib/libRDKitcoordgen.a                 
2026-03-04T15:43:16.1283405Z ../../../lib/libRDKitMolAlign.a ../../../lib/libRDKitMolTransforms.a            
2026-03-04T15:43:16.1283600Z ../../../lib/libRDKitEigenSolvers.a ../../../lib/libRDKitAlignment.a            
2026-03-04T15:43:16.1283807Z ../../../lib/libRDKitSubstructMatch.a ../../../lib/libRDKitGenericGroups.a      
2026-03-04T15:43:16.1284169Z ../../../lib/libRDKitSmilesParse.a ../../../lib/libRDKitGraphMol.a              
2026-03-04T15:43:16.1284377Z ../../../lib/libRDKitRDGeometryLib.a ../../../lib/libRDKitDataStructs.a         
2026-03-04T15:43:16.1284613Z ../../../lib/libRDKitRingDecomposerLib.a                                        
2026-03-04T15:43:16.1284840Z /home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_nu
2026-03-04T15:43:16.1284972Z mpy313.a                                                                        
2026-03-04T15:43:16.1285192Z /home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_py
2026-03-04T15:43:16.1285323Z thon313.a                                                                       
2026-03-04T15:43:16.1285557Z /home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_co
2026-03-04T15:43:16.1285696Z ntainer.a                                                                       
2026-03-04T15:43:16.1285918Z /home/runner/work/pyodide-recipes/pyodide-recipes/packages/.libs/lib/libboost_gr
2026-03-04T15:43:16.1286102Z aph.a ../../../lib/libRDKitRDGeneral.a                                          
2026-03-04T15:43:16.1286321Z -L/home/runner/work/pyodide-recipes/pyodide-recipes/emsdk/upstream/emscripten/ca
2026-03-04T15:43:16.1286521Z che/sysroot/lib/wasm32-emscripten/pic                                           
2026-03-04T15:43:16.1286733Z -L/home/runner/work/pyodide-recipes/pyodide-recipes/emsdk/upstream/emscripten/sr
2026-03-04T15:43:16.1286861Z c/lib                                                                           
2026-03-04T15:43:16.1287085Z /home/runner/work/pyodide-recipes/pyodide-recipes/emsdk/upstream/emscripten/cach
2026-03-04T15:43:16.1287297Z e/sysroot/lib/wasm32-emscripten/pic/crtbegin.o -mllvm                           
2026-03-04T15:43:16.1287532Z -combiner-global-alias-analysis=false -mllvm -wasm-enable-sjlj -mllvm           
2026-03-04T15:43:16.1287754Z -wasm-use-legacy-eh -mllvm -disable-lsr -mllvm -wasm-enable-eh -mllvm           
2026-03-04T15:43:16.1288088Z -wasm-use-legacy-eh -mllvm -exception-model=wasm --import-memory --shared-memory
2026-03-04T15:43:16.1288300Z --strip-debug --export=__wasm_call_ctors --export=_emscripten_tls_init          
2026-03-04T15:43:16.1288507Z --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm            
2026-03-04T15:43:16.1288718Z --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps  
2026-03-04T15:43:16.1288913Z --export-if-defined=__start_em_js --export-if-defined=__stop_em_js              
2026-03-04T15:43:16.1289118Z --export-if-defined=main --export-if-defined=__main_argc_argv                   
2026-03-04T15:43:16.1289322Z --export-if-defined=__wasm_apply_data_relocs --experimental-pic                 
2026-03-04T15:43:16.1289544Z --unresolved-symbols=import-dynamic -shared --no-export-dynamic' failed         
2026-03-04T15:43:16.1289680Z (returned 1)                                                                    
2026-03-04T15:43:16.1289893Z make[2]: *** [External/INCHI-API/Wrap/CMakeFiles/rdinchi.dir/build.make:123:    
2026-03-04T15:43:16.1290067Z rdkit/Chem/rdinchi.so] Error 1                                                  

Turning that off, the same problem occurs with Avalon:

[ 35%] Linking CXX shared module ../../../rdkit/Avalon/pyAvalonTools.so

Then freesasa:

[ 34%] Linking CXX shared module ../../../rdkit/Chem/rdFreeSASA.so

Then coordgen:

[ 32%] Linking CXX shared module ../../../rdkit/Chem/rdCoordGen.so              

Then YAeHMOP:

[ 37%] Building CXX object                                                      
External/YAeHMOP/CMakeFiles/testEHTLib1.dir/test1.cpp.o                         
[ 37%] Linking CXX executable testEHTLib1.js                                    

@fxcoudert
Copy link
Copy Markdown
Author

Cleverer approach in #538

@fxcoudert fxcoudert closed this Mar 18, 2026
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

Successfully merging this pull request may close these issues.

3 participants