Site Tools


Sidebar

software:performance_co-pilot:compiling_on_macosx

Compiling on Mac OSX 13.5

2023-10

# to install brew, as user execute this:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/chorn/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
    
# as user, install dependencies
brew install gnu-tar pkg-config
(echo; echo 'export PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"') >> /Users/chorn/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

# build PCP, as normal user
cd ~
mkdir pcpserv && cd pcpserv
git clone https://github.com/performancecopilot/pcp
cd pcp
./Makepkgs

# we use clang, native from MacOSX

Installing

Don't do it like this - not working so far for me.

sudo su -
cd /Users/chorn/pcpserv/pcp/pcp-6.1.1/build/tar
    # ./preinstall
    
preinstall needs a small fix:  on line 172:
-      $PCP_ETC_DIR/pcp/indom.config \
+      $PCP_ETC_DIR/pcp/indom.config; \ 
   
    # here=`pwd`
    # ( cd /; tar xpf $here/pcp-*-[0-9]*.tar.gz )

etc/init.d/pcp: Cannot extract through symlink etc/init.d/pcp
etc/init.d/pmcd: Cannot extract through symlink etc/init.d/pmcd
etc/init.d/pmie: Cannot extract through symlink etc/init.d/pmie
etc/init.d/pmlogger: Cannot extract through symlink etc/init.d/pmlogger
etc/init.d/pmproxy: Cannot extract through symlink etc/init.d/pmproxy
etc/pcp.conf: Cannot extract through symlink etc/pcp.conf
etc/pcp.env: Cannot extract through symlink etc/pcp.env
etc/pcp/bind2/bind2.conf: Cannot extract through symlink etc/pcp/bind2/bind2.conf

=> This does not succeed, as /etc and /var are symlinks. 

Maybe this:
(cd /private;     tar xpf $here/pcp-*-[0-9]*.tar.gz )
    
    # ./postinstall

Current issue

chorn-mac:tar root# /etc/init.d/pmcd start
Starting pmcd ... dyld[54447]: Library not loaded: libpcp_pmda.3.dylib
  Referenced from: <05A9191A-372A-3085-A9AD-313B3FDBC677> /usr/local/libexec/pcp/bin/pmcd
  Reason: tried: 'libpcp_pmda.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibpcp_pmda.3.dylib' (no such file), 'libpcp_pmda.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp_pmda.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/private/var/log/pcp/pmcd/libpcp_pmda.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp_pmda.3.dylib' (no such file)
/etc/init.d/pmcd: line 588: 54447 Abort trap: 6           $PMCD --verify $OPTS
/etc/init.d/pmcd: pmcd --verify -A failed, cannot start pmcd.
chorn-mac:tar root#

### trying to fix the libs
<code>
chorn-mac:tar root# otool -L /usr/local/libexec/pcp/bin/pmcd
/usr/local/libexec/pcp/bin/pmcd:
	libpcp_pmda.3.dylib (compatibility version 0.0.0, current version 0.0.0)
	libpcp.3.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)
chorn-mac:tar root# install_name_tool -change libpcp_pmda.3.dylib /private//usr/local/lib/libpcp_pmda.3.dylib  /usr/local/libexec/pcp/bin/pmcd
chorn-mac:tar root# install_name_tool -change libpcp.3.dylib /private//usr/local/lib/libpcp.3.dylib /usr/local/libexec/pcp/bin/pmcd

chorn-mac:tar root# /etc/init.d/pmcd start
Starting pmcd ... [Fri Oct 13 18:17:17] pmcd(56086) Error: __pmGetAddrInfo(chorn-mac), Resolver Error 0 (no error)
dyld[56092]: Library not loaded: libpcp.3.dylib
  Referenced from: <F2BF212D-C0C2-3BE8-8EB2-9CD86941A3CC> /usr/local/libexec/pcp/bin/pmcd_wait
  Reason: tried: 'libpcp.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibpcp.3.dylib' (no such file), 'libpcp.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file)
/etc/init.d/pmcd: line 341: 56092 Abort trap: 6           $PCP_BINADM_DIR/pmcd_wait $wait_option
dyld[56095]: Library not loaded: libpcp.3.dylib
  Referenced from: <C54184AC-AAB7-3F58-829D-ABB8A7C4DB6F> /usr/local/libexec/pcp/bin/pmpost
  Reason: tried: 'libpcp.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibpcp.3.dylib' (no such file), 'libpcp.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file), '/private/var/log/pcp/pmcd/libpcp.3.dylib' (no such file)
/etc/init.d/pmcd: line 341: 56095 Abort trap: 6           $PCP_BINADM_DIR/pmpost "$message"
failed (status=134)
software/performance_co-pilot/compiling_on_macosx.txt ยท Last modified: 2023/10/13 09:17 by chris