Installation

Installing on my Mac: Apache perl modules

Installing on my Mac: Apache perl modules

by Alex Jordan -
Number of replies: 4
I'm trying to install WeBWorK on my Mac (El Capitan) so that it will be easier for me to do development, testing, and submit pull requests. I manage PCC's WeBWorK server, but I've never installed WeBWorK, and I'm running into troubles. And I can't tell how much has to do with this being a Mac instead of some flavor of Linux.

My current issue is that I can't get the following perl modules to install. Here's a clip from check_modules:

** Apache2::Request not found in @INC
** Apache2::Cookie not found in @INC
** Apache2::ServerRec not found in @INC
** Apache2::ServerUtil not found in @INC

I'll paste the log below for Apache2::Request. The first possible issue I see in the log is "Please upgrade mod_perl2 first." I've not been able to figure out how to address this from searching online threads. Does anyone have a suggestion for addressing this? Or anything else in the log?


syst203m4138:bin alex.jordan$ sudo cpan Apache2::Request
Password:
Reading '/Users/alex.jordan/.cpan/Metadata'
Database was generated on Tue, 03 May 2016 07:17:02 GMT
Running install for module 'Apache2::Request'
Running make for I/IS/ISAAC/libapreq2-2.13.tar.gz
Checksum for /Users/alex.jordan/.cpan/sources/authors/id/I/IS/ISAAC/libapreq2-2.13.tar.gz ok

CPAN.pm: Building I/IS/ISAAC/libapreq2-2.13.tar.gz

perl: 18 ok
build/version_check.pl failed: no version_string found in '' for 'mod_perl2'.
Please upgrade mod_perl2 first.
Apache::Test: 1.39 ok
ExtUtils::MakeMaker: 6.66 ok
ExtUtils::XSBuilder: 0.28 ok
Test::More: 0.98 ok
Use of uninitialized value $args{"with-apache2-apxs"} in concatenation (.) or string at Makefile.PL line 91.
./configure --enable-perl-glue --with-perl="/usr/bin/perl" --with-apache2-apxs=""
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... i386-apple-darwin15.4.0
checking host system type... i386-apple-darwin15.4.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... gfortran
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -B output from gcc object... rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
rm: conftest.dSYM: is a directory
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.4.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fno-common
checking if gfortran PIC flag -fno-common works... yes
checking if gfortran static flag -static works... no
checking if gfortran supports -c -o file.o... yes
checking whether the gfortran linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.4.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
checking for ranlib... (cached) ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
./configure: line 20252: -q: command not found
./configure: line 20266: -q: command not found
./configure: line 20270: -q: command not found
./configure: line 20274: -q: command not found
./configure: line 20274: -q: command not found
build/version_check.pl failed: no version_string found in '' for 'apache2'.
configure: error: Bad apache2 binary (/)
Warning: No success on command[/usr/bin/perl Makefile.PL]
ISAAC/libapreq2-2.13.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites

In reply to Alex Jordan

Re: Installing on my Mac: Apache perl modules

by Michael Gage -
I haven't built apache recently on a Mac so I can't answer definitively.  Those missing CPAN modules are ones that are not installed individually but are installed when the mod_perl 2 module is installed.

Have you looked at 

http://blog.n42designs.com/blog/2014/10/23/compiling-mod-perl-for-apache-2-dot-4-on-os-x-10-dot-10-yosemite/

this is for a slightly earlier MacOS but I think it still might be helpful.

http://blog.n42designs.com/blog/2014/10/23/compiling-mod-perl-for-apache-2-dot-4-on-os-x-10-dot-10-yosemite/

and this 

http://apple.stackexchange.com/questions/225590/running-mod-perl-on-el-capitan


This might be important as well.  
https://lists.macosforge.org/pipermail/macports-users/2015-November/039810.html

libapreq2 used to be the module that you installed to get mod_perl2 I don't know if that is still the case with the el capitan.

Another thing to look at is to install MAMP and then install webwork in that.  MAMP is what I have been using to run Moodle on my mac.  

I haven't run WW that way because I have a build (using older versions of perl) of WW  that runs in a .dmg file.  I can email that to you if you wish.

-- Mike

In reply to Michael Gage

Re: Installing on my Mac: Apache perl modules

by Alex Jordan -
Thanks Mike,

I had seen those, but ultimately they were 90% of what I needed. Additionally I had to reboot in the command-r mode, and use the terminal there to:
csrutil disable

then reboot and follow the steps. And at some point I had to force install Apache2::Request after some tests failed. I reenabled csrutil.

All of my perl modules check out now, except that check_modules also outputs:

...
...
Iterator found and loaded
Iterator::Util found and loaded
Prototype mismatch: sub main::from_json: none vs ($@) at (eval 190) line 2.
Prototype mismatch: sub main::to_json: none vs ($@) at (eval 190) line 2.
JSON found and loaded
...
...

Should I be concerned about these Prototype mismatches?
In reply to Alex Jordan

Re: Installing on my Mac: Apache perl modules

by Michael Gage -
You probably don't need to worry about the prototype mismatch.  I believe I've seen those before although I haven't checked the most recent version.

We should get together and write up detailed install description.

What does the csrutil do?   

Take care,

Mike

In reply to Michael Gage

Re: Installing on my Mac: Apache perl modules

by Alex Jordan -
> We should get together and write up detailed install description.

I'm happy to try, but I was not keeping a good log of my steps. I could grab my colleague's new Mac and do a better job if you'd like to work on that.

> What does the csrutil do?

Apparently it is System Integrity Protection. When I tried to this line from the steps at one of those links:

perl Makefile.PL MP_CCOPTS=-std=gnu89 ; make ; sudo make install

I got some message like "You are not allowed to do this." Not even with sudo. Searching the error message led to the suggestion to disable it. (But also to re-enable it after running that command.)