Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Compilation of ton on OpenBSD/adJ #85

Closed
wants to merge 3 commits into from
Closed

Compilation of ton on OpenBSD/adJ #85

wants to merge 3 commits into from

Conversation

vtamara
Copy link

@vtamara vtamara commented Apr 18, 2022

This patch solves two problems ocurring during compilation of ton in OpenBSD/adJ in order to close ton-blockchain#337:

  1. The most recent version of abseil-cpp is required (becase it is answer to our report of problems to compile that library on OpenBSD/adJ, see Compilation issues on OpenBSD/adJ 7.1a1 abseil/abseil-cpp#1153)
  2. In OpenBSD/adJ there is no library dl

However to compile just the 3 tools func, fift and lite-client, there is a weird situation (The library tl/libtl_api.a generated during the compilation will not include correctly the symbols of tl/CMakeFiles/tl_api.dir/generate/auto/tl/ton_api.cpp.o). So at the moment of this writing to compile just those 3 tools in adJ 7.1a1:

doas pkg_add libminihttpd
git clone https://github.com/vtamara/ton.git
cd ton
git checkout adJ
git submodule update --init
cd ..
mkdir liteclient-build
cd liteclient-build
cmake ../ton
cmake --build . --target lite-client
echo "../tl/CMakeFiles/tl_api.dir/generate/auto/tl/ton_api.cpp.o" >>  lite-client/CMakeFiles/lite-client.dir/link.txt
cmake --build . --target lite-client
cmake --build . --target func
cmake --build . --target fift

With the tools generated this way I was able to run the func contracts made for the TON contest https://ton.org/contest withouth issue (for that contest I had to use Linux, but thanks to God now everything working on OpenBSD/adJ).

@vtamara
Copy link
Author

vtamara commented Apr 18, 2022

I prepared a package of TON for adJ/OpenBSD 7.1a1, and it doesn't present the weird problem with the generated tl/libtl_api.a:
https://github.com/pasosdeJesus/adJ/tree/main/arboldes/usr/ports/mystuff/net/ton

Once installed:

 % pkg_info -L ton                                                      
Information for inst:ton-20220417                                               
                                                                                
Files:                                                                          
/usr/local/bin/create-hardfork                                                  
/usr/local/bin/dht-server                                                       
/usr/local/bin/fift                                                             
/usr/local/bin/func                                                             
/usr/local/bin/generate-random-id                                               
/usr/local/bin/lite-client                                                      
/usr/local/bin/pow-miner                            
/usr/local/bin/tonlib-cli                                                       
/usr/local/bin/validator-engine                                                 
/usr/local/bin/validator-engine-console                                         
/usr/local/include/tonlib/tonlib_client_json.h       
/usr/local/include/tonlib/tonlibjson_export.h        
/usr/local/lib/cmake/Tonlib/TonlibConfig.cmake       
/usr/local/lib/cmake/Tonlib/TonlibConfigVersion.cmake
/usr/local/lib/cmake/Tonlib/TonlibTargets-release.cmake
/usr/local/lib/cmake/Tonlib/TonlibTargets.cmake        
/usr/local/lib/fift/Asm.fif                                
/usr/local/lib/fift/Color.fif                                                                                                                                   
/usr/local/lib/fift/Fift.fif                                                    
/usr/local/lib/fift/GetOpt.fif                                                  
/usr/local/lib/fift/Lisp.fif                                                    
/usr/local/lib/fift/Lists.fif                                                   
/usr/local/lib/fift/Stack.fif                                                   
/usr/local/lib/fift/TonUtil.fif                                                 
/usr/local/lib/libtdactor.a                                                     
/usr/local/lib/libtddb.a                                                        
/usr/local/lib/libtddb_utils.a                                                  
/usr/local/lib/libtdutils.a                                                     
/usr/local/lib/libtonlibjson.so.0.0                 
/usr/local/share/ton/smartcont/CreateState.fif                                  
/usr/local/share/ton/smartcont/asm-to-cpp.fif                                   
/usr/local/share/ton/smartcont/auto-dns.fif                                     
/usr/local/share/ton/smartcont/auto/config-code.cpp  
/usr/local/share/ton/smartcont/auto/config-code.fif  
/usr/local/share/ton/smartcont/auto/dns-auto-code.cpp
/usr/local/share/ton/smartcont/auto/dns-auto-code.fif
/usr/local/share/ton/smartcont/auto/dns-manual-code.cpp
/usr/local/share/ton/smartcont/auto/dns-manual-code.fif
/usr/local/share/ton/smartcont/auto/elector-code.cpp         
/usr/local/share/ton/smartcont/auto/elector-code.fif                                                                                                            
/usr/local/share/ton/smartcont/auto/highload-wallet-code.cpp                    
/usr/local/share/ton/smartcont/auto/highload-wallet-code.fif                    
/usr/local/share/ton/smartcont/auto/highload-wallet-v2-code.cpp                 
/usr/local/share/ton/smartcont/auto/highload-wallet-v2-code.fif                 
/usr/local/share/ton/smartcont/auto/multisig-code.cpp                           
/usr/local/share/ton/smartcont/auto/multisig-code.fif                           
/usr/local/share/ton/smartcont/auto/payment-channel-code.cpp                    
/usr/local/share/ton/smartcont/auto/payment-channel-code.fif                    
/usr/local/share/ton/smartcont/auto/pow-testgiver-code.cpp                      
/usr/local/share/ton/smartcont/auto/pow-testgiver-code.fif                      
/usr/local/share/ton/smartcont/auto/restricted-wallet-code.cpp
/usr/local/share/ton/smartcont/auto/restricted-wallet-code.fif                  
/usr/local/share/ton/smartcont/auto/restricted-wallet2-code.cpp                 
/usr/local/share/ton/smartcont/auto/restricted-wallet2-code.fif                 
/usr/local/share/ton/smartcont/auto/restricted-wallet3-code.cpp
/usr/local/share/ton/smartcont/auto/restricted-wallet3-code.fif
/usr/local/share/ton/smartcont/auto/simple-wallet-code.cpp
/usr/local/share/ton/smartcont/auto/simple-wallet-code.fif
/usr/local/share/ton/smartcont/auto/simple-wallet-ext-code.cpp
/usr/local/share/ton/smartcont/auto/simple-wallet-ext-code.fif
/usr/local/share/ton/smartcont/auto/wallet-code.cpp           
/usr/local/share/ton/smartcont/auto/wallet-code.fif                                                                                                             
/usr/local/share/ton/smartcont/auto/wallet3-code.cpp                            
/usr/local/share/ton/smartcont/auto/wallet3-code.fif                            
/usr/local/share/ton/smartcont/complaint-vote-req.fif                           
/usr/local/share/ton/smartcont/complaint-vote-signed.fif                        
/usr/local/share/ton/smartcont/config-code.fc                                   
/usr/local/share/ton/smartcont/config-proposal-vote-req.fif                     
/usr/local/share/ton/smartcont/config-proposal-vote-signed.fif                  
/usr/local/share/ton/smartcont/create-config-proposal.fif                       
/usr/local/share/ton/smartcont/create-config-upgrade-proposal.fif               
/usr/local/share/ton/smartcont/create-elector-upgrade-proposal.fif              
/usr/local/share/ton/smartcont/dns-auto-code.fc               
/usr/local/share/ton/smartcont/dns-manual-code.fc                               
/usr/local/share/ton/smartcont/elector-code.fc                                  
/usr/local/share/ton/smartcont/envelope-complaint.fif                           
/usr/local/share/ton/smartcont/gen-zerostate-test.fif          
/usr/local/share/ton/smartcont/gen-zerostate.fif               
/usr/local/share/ton/smartcont/highload-wallet-code.fc    
/usr/local/share/ton/smartcont/highload-wallet-v2-code.fc 
/usr/local/share/ton/smartcont/highload-wallet-v2-one.fif     
/usr/local/share/ton/smartcont/highload-wallet-v2.fif         
/usr/local/share/ton/smartcont/highload-wallet.fif                      
/usr/local/share/ton/smartcont/manual-dns-manage.fif                                                                                                            
/usr/local/share/ton/smartcont/multisig-code.fc                                 
/usr/local/share/ton/smartcont/new-auto-dns.fif                                 
/usr/local/share/ton/smartcont/new-highload-wallet-v2.fif                       
/usr/local/share/ton/smartcont/new-highload-wallet.fif                          
/usr/local/share/ton/smartcont/new-manual-dns.fif                               
/usr/local/share/ton/smartcont/new-pinger.fif                                   
/usr/local/share/ton/smartcont/new-pow-testgiver.fif                            
/usr/local/share/ton/smartcont/new-restricted-wallet.fif                        
/usr/local/share/ton/smartcont/new-restricted-wallet2.fif                       
/usr/local/share/ton/smartcont/new-restricted-wallet3.fif                       
/usr/local/share/ton/smartcont/new-testgiver.fif              
/usr/local/share/ton/smartcont/new-wallet-v2.fif                                
/usr/local/share/ton/smartcont/new-wallet-v3.fif                                
/usr/local/share/ton/smartcont/new-wallet.fif                                   
/usr/local/share/ton/smartcont/payment-channel-code.fc         
/usr/local/share/ton/smartcont/pow-testgiver-code.fc           
/usr/local/share/ton/smartcont/recover-stake.fif          
/usr/local/share/ton/smartcont/restricted-wallet-code.fc  
/usr/local/share/ton/smartcont/restricted-wallet2-code.fc     
/usr/local/share/ton/smartcont/restricted-wallet3-code.fc     
/usr/local/share/ton/smartcont/show-addr.fif 
/usr/local/share/ton/smartcont/simple-wallet-code.fc                            
/usr/local/share/ton/smartcont/simple-wallet-ext-code.fc                        
/usr/local/share/ton/smartcont/stdlib.fc                                        
/usr/local/share/ton/smartcont/testgiver.fif                                    
/usr/local/share/ton/smartcont/update-config-smc.fif                            
/usr/local/share/ton/smartcont/update-config.fif                                
/usr/local/share/ton/smartcont/update-elector-smc.fif                           
/usr/local/share/ton/smartcont/validator-elect-req.fif        
/usr/local/share/ton/smartcont/validator-elect-signed.fif                       
/usr/local/share/ton/smartcont/wallet-code.fc                                   
/usr/local/share/ton/smartcont/wallet-v2.fif                                    
/usr/local/share/ton/smartcont/wallet-v3-code.fif              
/usr/local/share/ton/smartcont/wallet-v3.fif                   
/usr/local/share/ton/smartcont/wallet.fif                 
/usr/local/share/ton/smartcont/wallet3-code.fc           

With these tools I also could run the tests for the tasks of the contest without issue.

@EmelyanenkoK
Copy link
Member

First of all, thank you for pool request!
This request however include massive update of code related to update of abseil-cpp. Such update requires thorough testing and prolonged run in testnet. We scheduled update of abseil-cpp so lets postpone accept of this PR till the update.
I will leave this PR open, so anybody who need adJ/OpenBSD build (for instance for func/lite-client and other not that consensus critical staff) can find and use it.

@vtamara vtamara closed this by deleting the head repository Dec 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linking of lite-client failing in OpenBSD/adJ 7.1a1
2 participants