Forum

Question for those who compiled from source

chapchap70
2 May 2016, 03:39
I'm a newby as far as compiling and building goes but I think I successfully installed 10.2 on my computer. One thing I got confused from the README is I thought I was supposed to run cmake, make, and make install/strip from the "build" directory but it didn't work from there, it was looking for files in the ./hiawatha-10.2 directory. Did I misunderstand the instructions or is there an error in the README?
Hugo Leisink
2 May 2016, 09:57
If you first create a build directory and that change to it, don't run 'cmake', but 'cmake ..'. Did you do that?
chapchap70
3 May 2016, 00:49
Hi Hugo,

Thanks for your great work. The latest version of Hiawatha I could get from my distro/variants was 8.6 which I have been using on my website. I wanted to see if I could compile the latest and get Banshee working. I couldn't even tell you for sure how the cmake.. works. (commas after options, brackets, etc.) Like I said, I am a newby at this. When I looked at CMake --help and saw that the -i switch was the "wizard" mode, I decided that was about my speed. Below was how it turned out... After that, I just did "make" then "make install". When I ran the wizard from within the build directory, I got "CMake Error: The source directory "../hiawatha-10.2/build" does not appear to contain CMakeLists.txt."... I tried copying/moving files into the build directory but got more errors so I moved to the ../hiawatha-10.2 directory and it worked from there. It does work, but I was just curious as to why. The difference in starting the old and new is the old I just type "hiawatha" and the new is "/usr/local/sbin/hiawatha"

Just relaying my experience in the forum. Thanks again.



# cmake -i
Would you like to see advanced options? [No]:n
Please wait while cmake processes CMakeLists.txt files....



Variable Name: CMAKE_BUILD_TYPE
Description: Choose the type of build: None Debug Release Coverage ASan ASanDbg MemSan MemSanDbg Check CheckFull
Current Value: RelWithDebInfo
New Value (Enter to keep current value):

Variable Name: CMAKE_INSTALL_PREFIX
Description: Install path prefix, prepended onto install directories.
Current Value: /usr/local
New Value (Enter to keep current value):

Variable Name: CONFIG_DIR
Description: Configuration directory
Current Value: /usr/local/etc/hiawatha
New Value (Enter to keep current value):

Variable Name: ENABLE_CACHE
Description: Enable cache support in Hiawatha.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_IPV6
Description: Enable IPv6 support in Hiawatha.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_LOADCHECK
Description: Enable the ability to check for server load.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_MONITOR
Description: Enable support for the Hiawatha Monitor.
Current Value: OFF
New Value (Enter to keep current value): ON

Variable Name: ENABLE_RPROXY
Description: Enable reverse proxy support in Hiawatha.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_TLS
Description: Enable TLS (mbed TLS) support in Hiawatha.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_TOMAHAWK
Description: Enable Tomahawk in Hiawatha
Current Value: OFF
New Value (Enter to keep current value): ON

Variable Name: ENABLE_TOOLKIT
Description: Enable the URL toolkit in Hiawatha
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_XSLT
Description: Enable XSLT support in Hiawatha.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: ENABLE_ZLIB_SUPPORT
Description: Build mbed TLS with zlib library.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: LINK_WITH_PTHREAD
Description: Explicitly link mbed TLS library to pthread.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: LOG_DIR
Description: Log directory
Current Value: /usr/local/var/log/hiawatha
New Value (Enter to keep current value):

Variable Name: PID_DIR
Description: PID directory
Current Value: /usr/local/var/run
New Value (Enter to keep current value):

Variable Name: USE_PKCS11_HELPER_LIBRARY
Description: Build mbed TLS with the pkcs11-helper library.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: USE_SHARED_MBEDTLS_LIBRARY
Description: Build mbed TLS shared library.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: USE_STATIC_MBEDTLS_LIBRARY
Description: Build mbed TLS static library.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: USE_SYSTEM_MBEDTLS
Description: Use the system's mbed TLS (>=2.0.0) library.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: WEBROOT_DIR
Description: Webroot directory
Current Value: /usr/local/var/www/hiawatha
New Value (Enter to keep current value):

Variable Name: WORK_DIR
Description: Work directory
Current Value: /usr/local/var/lib/hiawatha
New Value (Enter to keep current value):

Please wait while cmake processes CMakeLists.txt files....



CMake complete, run make to build project.

# make
Scanning dependencies of target cgi-wrapper
[ 0%] Building C object CMakeFiles/cgi-wrapper.dir/src/alternative.c.o
[ 1%] Building C object CMakeFiles/cgi-wrapper.dir/src/cgi-wrapper.c.o
[ 2%] Building C object CMakeFiles/cgi-wrapper.dir/src/memdbg.c.o
[ 3%] Building C object CMakeFiles/cgi-wrapper.dir/src/libfs.c.o
[ 4%] Building C object CMakeFiles/cgi-wrapper.dir/src/libstr.c.o
[ 4%] Building C object CMakeFiles/cgi-wrapper.dir/src/userconfig.c.o
Linking C executable cgi-wrapper
[ 4%] Built target cgi-wrapper
Scanning dependencies of target mbedcrypto
[ 5%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/aes.c.o
[ 6%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/aesni.c.o
[ 7%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/arc4.c.o
[ 8%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/asn1parse.c.o
[ 9%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/asn1write.c.o
[ 9%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/base64.c.o
[ 10%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/bignum.c.o
[ 11%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/blowfish.c.o
[ 12%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/camellia.c.o
[ 13%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ccm.c.o
[ 14%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/cipher.c.o
[ 14%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/cipher_wrap.c.o
[ 15%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ctr_drbg.c.o
[ 16%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/des.c.o
[ 17%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/dhm.c.o
[ 18%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ecdh.c.o
[ 18%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ecdsa.c.o
[ 19%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ecjpake.c.o
[ 20%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ecp.c.o
[ 21%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ecp_curves.c.o
[ 22%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/entropy.c.o
[ 23%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.o
[ 23%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/error.c.o
[ 24%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/gcm.c.o
[ 25%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/havege.c.o
[ 26%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/hmac_drbg.c.o
[ 27%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/md.c.o
[ 28%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/md2.c.o
[ 28%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/md4.c.o
[ 29%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/md5.c.o
[ 30%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/md_wrap.c.o
[ 31%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/memory_buffer_alloc.c.o
[ 32%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/oid.c.o
[ 33%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/padlock.c.o
[ 33%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pem.c.o
[ 34%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pk.c.o
[ 35%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pk_wrap.c.o
[ 36%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pkcs12.c.o
[ 37%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pkcs5.c.o
[ 37%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pkparse.c.o
[ 38%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/pkwrite.c.o
[ 39%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/platform.c.o
[ 40%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/ripemd160.c.o
[ 41%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/rsa.c.o
[ 42%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/sha1.c.o
[ 42%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/sha256.c.o
[ 43%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/sha512.c.o
[ 44%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/threading.c.o
[ 45%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/timing.c.o
[ 46%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/version.c.o
[ 47%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/version_features.c.o
[ 47%] Building C object mbedtls/library/CMakeFiles/mbedcrypto.dir/xtea.c.o
Linking C shared library libmbedcrypto.so
[ 47%] Built target mbedcrypto
Scanning dependencies of target mbedx509
[ 48%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/certs.c.o
[ 48%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/pkcs11.c.o
[ 49%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509.c.o
[ 50%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509_create.c.o
[ 51%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509_crl.c.o
[ 52%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509_crt.c.o
[ 53%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509_csr.c.o
[ 53%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509write_crt.c.o
[ 54%] Building C object mbedtls/library/CMakeFiles/mbedx509.dir/x509write_csr.c.o
Linking C shared library libmbedx509.so
[ 54%] Built target mbedx509
Scanning dependencies of target mbedtls
[ 55%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/debug.c.o
[ 56%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/net.c.o
[ 57%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cache.c.o
[ 58%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ciphersuites.c.o
[ 59%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cli.c.o
[ 59%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cookie.c.o
[ 60%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_srv.c.o
[ 61%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ticket.c.o
[ 62%] Building C object mbedtls/library/CMakeFiles/mbedtls.dir/ssl_tls.c.o
Linking C shared library libmbedtls.so
[ 62%] Built target mbedtls
Scanning dependencies of target hiawatha
[ 63%] Building C object CMakeFiles/hiawatha.dir/src/alternative.c.o
[ 64%] Building C object CMakeFiles/hiawatha.dir/src/cache.c.o
[ 65%] Building C object CMakeFiles/hiawatha.dir/src/cgi.c.o
[ 66%] Building C object CMakeFiles/hiawatha.dir/src/challenge.c.o
[ 67%] Building C object CMakeFiles/hiawatha.dir/src/client.c.o
[ 67%] Building C object CMakeFiles/hiawatha.dir/src/envir.c.o
[ 68%] Building C object CMakeFiles/hiawatha.dir/src/filehashes.c.o
[ 69%] Building C object CMakeFiles/hiawatha.dir/src/hiawatha.c.o
[ 70%] Building C object CMakeFiles/hiawatha.dir/src/http.c.o
[ 71%] Building C object CMakeFiles/hiawatha.dir/src/httpauth.c.o
[ 72%] Building C object CMakeFiles/hiawatha.dir/src/ip.c.o
[ 72%] Building C object CMakeFiles/hiawatha.dir/src/libfs.c.o
[ 73%] Building C object CMakeFiles/hiawatha.dir/src/liblist.c.o
[ 74%] Building C object CMakeFiles/hiawatha.dir/src/libstr.c.o
[ 75%] Building C object CMakeFiles/hiawatha.dir/src/log.c.o
[ 76%] Building C object CMakeFiles/hiawatha.dir/src/memdbg.c.o
[ 77%] Building C object CMakeFiles/hiawatha.dir/src/mimetype.c.o
[ 77%] Building C object CMakeFiles/hiawatha.dir/src/monitor.c.o
[ 78%] Building C object CMakeFiles/hiawatha.dir/src/rproxy.c.o
[ 79%] Building C object CMakeFiles/hiawatha.dir/src/send.c.o
[ 80%] Building C object CMakeFiles/hiawatha.dir/src/serverconfig.c.o
[ 81%] Building C object CMakeFiles/hiawatha.dir/src/session.c.o
[ 81%] Building C object CMakeFiles/hiawatha.dir/src/tls.c.o
[ 82%] Building C object CMakeFiles/hiawatha.dir/src/target.c.o
[ 83%] Building C object CMakeFiles/hiawatha.dir/src/tomahawk.c.o
[ 84%] Building C object CMakeFiles/hiawatha.dir/src/toolkit.c.o
[ 85%] Building C object CMakeFiles/hiawatha.dir/src/userconfig.c.o
[ 86%] Building C object CMakeFiles/hiawatha.dir/src/workers.c.o
[ 86%] Building C object CMakeFiles/hiawatha.dir/src/xslt.c.o
Linking C executable hiawatha
[ 86%] Built target hiawatha
Scanning dependencies of target ssi-cgi
[ 87%] Building C object CMakeFiles/ssi-cgi.dir/src/alternative.c.o
[ 88%] Building C object CMakeFiles/ssi-cgi.dir/src/ip.c.o
[ 89%] Building C object CMakeFiles/ssi-cgi.dir/src/libfs.c.o
[ 90%] Building C object CMakeFiles/ssi-cgi.dir/src/liblist.c.o
[ 90%] Building C object CMakeFiles/ssi-cgi.dir/src/libstr.c.o
[ 91%] Building C object CMakeFiles/ssi-cgi.dir/src/memdbg.c.o
[ 92%] Building C object CMakeFiles/ssi-cgi.dir/src/ssi-cgi.c.o
Linking C executable ssi-cgi
[ 92%] Built target ssi-cgi
Scanning dependencies of target wigwam
[ 93%] Building C object CMakeFiles/wigwam.dir/src/alternative.c.o
[ 94%] Building C object CMakeFiles/wigwam.dir/src/filehashes.c.o
[ 95%] Building C object CMakeFiles/wigwam.dir/src/ip.c.o
[ 95%] Building C object CMakeFiles/wigwam.dir/src/libfs.c.o
[ 96%] Building C object CMakeFiles/wigwam.dir/src/libstr.c.o
[ 97%] Building C object CMakeFiles/wigwam.dir/src/liblist.c.o
[ 98%] Building C object CMakeFiles/wigwam.dir/src/memdbg.c.o
[ 99%] Building C object CMakeFiles/wigwam.dir/src/toolkit.c.o
[100%] Building C object CMakeFiles/wigwam.dir/src/wigwam.c.o
Linking C executable wigwam
[100%] Built target wigwam
#


chapchap70
3 May 2016, 01:40
Well, once I realized make .. simply m a k e then a space then two dots, .....

Laugh at my expense but I hope this helps someone. Seems to me that it works both ways.
Hugo Leisink
3 May 2016, 06:02
cmake needs the CmakeLists.txt file. It looks for it in the current directory. If you run it from the build directory, you need the specify where it is located, hence the .. parameter. There is no difference in running cmake from the source root directory or from the build directory in terms of the binaries it creates. Using the build directory only keeps the source directory clean. Removing the build directory returns it to its original state. Simply look in the build directory after a compile. You don't want all that stuff in your source, unless you compile and install once and then remove the entire source directory.

What distro are you using? If it uses .deb or .rpm packages, you can use one of the make_* scripts in the directory extra to create a Hiawatha package. Makes installation and deinstallation easier en cleaner.
chapchap70
3 May 2016, 16:45
Thanks for the explanation. I did notice that the way you have it puts a lot more files in the build directory. I use various Puppy variants that are derived from various places (Slackware, Ubuntu, Debian, etc.) Since these are so small and it is so easy to scrap and start over, I use these to try things out then start over clean (with a new savefile/directory) if I mess something up.
This topic has been closed.