Compile nginx 1.8.1 with http_perl_module - macos

I need help compiling nginx with the perl_module on my Mac:
System Software Overview:
System Version: OS X 10.11.1 (15B42)
Kernel Version: Darwin 15.0.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: Philipp
User Name: XXXXXXX XXXXXXXX (philipp)
Secure Virtual Memory: Enabled
Time since boot: 4 days 22:46
I configure nginx to be compiled with PCRE and PERL, i.e.,:
./configure --with-pcre=/Users/philipp/downloads/pcre-8.38 --with-http_perl_module --prefix=/servers/nginx
The output of the configure states:
checking for perl
+ perl version: This is perl 5, version 18, subversion 2 (v5.18.2)
built for darwin-thread-multi-2level
+ perl interpreter multiplicity found
If I execute make I run into the following error:
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I googled and found a hint to export KERNEL_BITS=64, which did not solve the problem. Any suggestions on how to compile nginx with perl. The compilation succeeds without the --with-http_perl_module option, but in that case I cannot use perl in the nginx.conf (of course :)).
UPDATE:
I was not able to compile nginx with perl. I ended up using a pre-compiled package, which is kind of unsatisfying, because now I have to deal with a lot of packages I don't like. Anyways, if someone has a solution I'd be more than happy to know.

I'm not sure if this is offtopic or not, but as it's about using perl within nginx (which I do, and is awesome).
I had a similar problem when trying to build this module. The root of it was that I hadn't got the right LD flags.
The easiest way of doing this - IMO - is install nginx from a package, run nginx -V and see what flags were used - copy them all, and include the extras. (And check it wasn't already build in your distribution - it was in mine, which I think was a Centos 7.2 package - I don't have it to hand, but I'm not sure it would necessarily help)
You may also need to install a new perl version, to go with it though.

--with-pcre=../modules/pcre-8.38
--with-openssl=../modules/openssl-1.0.2g
--prefix=/usr/local/nginx
--with-http_perl_module
--with-http_ssl_module
--with-http_addition_module
--with-http_sub_module
--with-http_realip_module
--with-http_stub_status_module
--with-cc-opt='-I /usr/local/include'
--with-ld-opt='-L /usr/local/lib -L/usr/local/opt/perl518/lib'
I got the same problem. after about 3 hours digging with this, finally solved. This is my configure file, i installed perl518 with brew located in /usr/local/opt/perl518/lib, and use the newest nginx source code of version nginx version: nginx/1.10.0.
Things seems happend as #Sobrique said, you need to give the right --with-ld-opt & --with-cc-opt.
important, after ./configure, DO NOT doing make immediately, vi ./objs/Makefile and modify openssl config from './config' to './Configure darwin-x86_64-cc' so that it can build openssl in x86_64 mod.
Hope it can help you!

Related

./configure doesn't find Qt5Core, QT5GUI, QT5Widgets

I've recently replaced Win10 by Linux Debian 11.2 on my PC (hence I'm a newbee in Linux). Now, not all programs are available as deb-Files.
I tried to compile source code - here a synthesizer ams-2.2.0 - from a tar.gz files (after unzipping into a separate folder) with steps (as written in the INSTALL.TXT to this source, and obviously usual)
./configure
make
make install
I get a bunch of error messages for missing files, when running ./congigure most resolved by installation of missing packages, but at last it fails with error message:
checking for QTCore Qt5Gui Qt5Widgets >= 5.0... no
configure: error: cannot find Qt5 library >= 5.0
(hope to get all written correctly, because I can't copy from the terminal ... Ctrl-Shift-C doesn't seem to work)
I checked the installation in synaptics and found that Qt-Version is 5.12. So what's wrong here?
I'm afraid to have this error message everytime I try to compile different source codes.
You need to install libqtcore and libqtwidgets with development headers, they are in qtbase5-dev package.
sudo apt install build-essential qtbase5-dev qtchooser

Broke yum on Centos 6.10, cannot install missing GLIBC in error due to missing libunwind

I was installing nvidia-drivers on Centos 6.10 which included a --skip-broken flag and may have broken yum. Whenever I ran yum commands this error pops up.
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by /lib64/libgcc_s.so.1)
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.6.6 (r266:84292, Jun 20 2019, 14:14:55)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
I stumbled upon this thread which talks about installing the missing GLIBC version, but I ran into this error in step 8 ../configure --prefix=/opt/glibc-2.14
checking for forced unwind support... no
configure: error: forced unwind support is required
Which then took me to this forum thread that states I should install libunwind via yum. Which was my original problem, thus leaving me at an impasse. What should I do?
You need to reinstall GCC, or more precisely the libgcc package. Something overwrote /lib64/libgcc_s.so.1 with an incompatible version. You should be able to download the libgcc RPM package from a mirror, and then run:
# rpm --reinstall libgcc-4.4.7-23.el6.x86_64.rpm
This should still work because RPM itself does not depend on libgcc_s.
In general, if you need newer versions of these core system libraries (glibc, libstdc++, libgcc_s), you need to upgrade the entire operating system. Even if you manage to replace them in a consistent fashion, you are running something that isn't very close to the original operating system anymore. At that point, it is more prudent to upgrade, because that will give you a consistent system that has been tested by many others.

while executing make of i3-gaps, undefined reference to `g_utf8_make_valid' error

After following all instructions from Compiling and Installing page, I have successfully installed all the packages required. After performing ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers, I get
build configured:
i3 version: 4.15.0.1-323-gccb1947 (2018-09-28, branch "gaps-next")
is release version: no
build manpages: no
build docs: no
enable debug flags: yes
code coverage: no
enabled sanitizers:
To compile, run:
cd /home/dharmin/i3-gaps/build && make -j8
Now, when I do make or make -j8, I get the following error
./libi3.a(libi3_a-string.o): In function `i3string_from_utf8_with_length':
/home/dharmin/i3-gaps/build/../../i3-gaps/libi3/string.c:59: undefined reference to `g_utf8_make_valid'
collect2: error: ld returned 1 exit status
On a quick google search, I found only one related reddit link. But that did not help solve the problem.
My current i3 version
Binary i3 version: 4.11 (2015-09-30, branch "4.11") © 2009 Michael Stapelberg and contributors
Linux Distribution & Version: Ubuntu 16.04
Thank you in advance for helping :)
I made a Reddit post mentioning this question. I was having the exact same problem and was tinkering away.
My final solution was to download version 4.13*, which does not make a reference to g_utf8_make_valid. If you have all the dependencies installed, it should compile fine.
* You are running 4.11. Installing 4.13 or something newer, depending on how new the libraries you can get are, might work, but I would try to install 4.11 in your case.

brew install nginx,how to change nginx.conf file location?

brew install openresty --with-debug --conf-path=/usr/local/nginx/conf/nginx.conf
but it no effect.
nginx -V
nginx version: openresty/1.9.7.4 (no pool)
built by clang 7.3.0 (clang-703.0.31)
built with OpenSSL 1.0.2h 3 May 2016
TLS SNI support enabled
configure arguments: ......--conf-path=/usr/local/etc/openresty/nginx.conf --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-pcre --with-pcre-jit --with-dtrace-probes --with-http_ssl_module
the nginx.conf file location not changed,still is the default.
The option you have specified --conf-path is not a homebrew supported option. You can see that by running this:
brew options openresty
Output
--with-debug
Compile with support for debug logging but without proper gdb debugging symbols
--with-geoip
Compile with ngx_http_geoip_module
--with-gunzip
Compile with ngx_http_gunzip_module
--with-iconv
Compile with support for converting character encodings
--with-postgresql
Compile with support for direct communication with PostgreSQL database servers
--with-stub_status
Compile with ngx_http_stub_status_module
--with-webdav
Compile with ngx_http_dav_module
--without-luajit
Compile *without* support for the Lua Just-In-Time Compiler
I think the only way to do what you want is to edit the formula, so you would do:
brew edit openresty
and then search down for conf-path, and edit the part that looks like this:
args = [
"--prefix=#{prefix}",
"--pid-path=#{var}/run/openresty.pid",
"--lock-path=#{var}/run/openresty.lock",
"--sbin-path=#{bin}/openresty",
"--conf-path=#{etc}/openresty/nginx.conf", <--- HERE
"--http-log-path=#{var}/log/nginx/access.log",
"--error-log-path=#{var}/log/nginx/error.log",
"--with-pcre",
"--with-pcre-jit",
"--with-cc-opt=#{cc_opt}",
"--with-ld-opt=#{ld_opt}",
]
You may need to do:
brew tap homebrew/nginx
before running the above commands.

Wordnet::Similarity installation issue

When I install Wordnet::Similarity on mac, the following error occur:
usr/local/bin/perl "-Iblib/arch" "-Iblib/lib" build/Depthfiles.PL blib/lib/WordNet/synsetdepths.dat
Generating default depth files.
Can't load '/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle' for module Digest::SHA1: dlopen(/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle, 1): no suitable image found. Did find:
/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Digest/SHA1/SHA1.bundle: mach-o, but wrong architecture at /usr/local/lib/perl5/5.8.8/darwin-2level/DynaLoader.pm line 230.
at blib/lib/WordNet/Tools.pm line 76
Compilation failed in require at blib/lib/WordNet/Tools.pm line 76.
My attempt was to enter to the downloaded package directory from terminal and type:
perl Makefile.PL
make
make test
sudo make install
I made sure to have installed all prerequisite http://search.cpan.org/dist/WordNet-Similarity/doc/install.pod#Prerequisites. I suspect that this may be due to mac processor version with Perl interface. Any suggestion on how to fix this?
Install libdigest-sha-perl in Ubuntu 14.04 has solved this issue.
Download link:http://packages.ubuntu.com/trusty/amd64/perl/libdigest-sha-perl

Resources