Updating Boost library in ubuntu - boost

My machine is an ubuntu 14.04 with ROS.
when I do :
$ dpkg -s libboost-dev | grep 'Version'
Version: 1.54.0.1ubuntu1
Now that I need to work with later versions (mainly 1.62)of Boost, I followed the answer found here, Boost 1.62 is installed but getting the boost version as above returns the same old 1.54.0.
Do I need to do anything else, so my system will point to the new 1.62 version ?
So the result to be is this :
$ dpkg -s libboost-dev | grep 'Version'
Version: 1.62.0.1ubuntu1
Thanks.

If you're installing a newer version of Boost outside dpkg, then dpkg obviously won't be aware of the new version (hence why running dpkg libboost-dev still points to the old version).
If Boost compiled/installed with no problems, then you just need to link the Boost libraries at compile time for whatever binary you're working on.

Related

How to download and install gcc for AIX 7?

I am new to installation work and AIX machine. I have gone through many sites and found it very difficult to follow/unrelated. I did find / | grep gcc and found only one gcc folder which cannot be executed. I tried installing gcc using the rpm - libgcc8-8.3.0-5.aix7.2.ppc.rpm and libgcc-8-1.aix7.2.ppc.rpm, still gcc not found. I will be thankful if I find some help on downloading and installing gcc in AIX machine. Please help.
# uname -v
7
# uname -a
AIX twa-aix72-01 2 7 00FB3B744C00
#
Used yum install gcc and then gave which gcc, I am able to see the gcc file path then. This worked. Yum downloads gcc package and installs I guess. For more details, please check the comments.

How do I build the Firebird database extension (ext-interbase) for PHP on a MacOS M1 Monterey?

Firebird Extension for PHP on MacOS M1
I have PHP7.4 installed with homebrew and the Xcode command line tools.
I followed the instructions as per the source repository here https://github.com/FirebirdSQL/php-firebird using the following methodology, I have changed the Linux formula to suite the MacOS library locations as per this answer here
Issues compiling firebird driver for PHP-7.4 on macos:
git clone https://github.com/FirebirdSQL/php-firebird.git
cd php-firebird
phpize
CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Resources/lib ./configure
make
The error I get is
configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information.
In the log file it refers to the following which is the crux of the issue
ld: warning: ignoring file /opt/firebird/lib/libib_util.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
The problem is that the Firebird package for Mac is only built for the 64bit architecture and not the ARM architecture.
Solution
I always seem to struggle building the extension for Firebird on MacOS (Intel or M1) and after a month of leaving the problem I discovered the solution which I leave here for myself all of you who have hit this wall, until ARM is supported on MacOS for Firebird we probably have to run the 64 bit version with 64 bit PHP. The steps below should get you up and running. I came up with 2 solutions, the first most obvious one was to make a docker build.
Docker Solution
docker run -v $(pwd):/app tina4stack/php -ini | grep interbase
Home brew solution
The second solution (more complicated) was to follow these steps, I don't always like to run a docker engine for simple things.
Install latest Firebird for MacOS
First, make sure you have installed the latest Firebird MacOS package, Firebird 3.0 at the time of writing has only one you can install.
The next problem I ran into was home-brew had installed an ARM version of PHP which made the linking to the x86_64 architecture impossible. Kudos to the documentation here https://austencam.com/posts/setting-up-an-m1-mac-for-laravel-development-with-homebrew-php-mysql-valet-and-redis
Install Rosetta
First I installed Rosetta (helps run 64 bit apps on MacOS ARM)
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
Install Home-brew for 64bit architecture
Next I removed homebrew and reinstalled it with the arch -x86_64 bit flag
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install PHP7.4
Then installed a fresh php#7.4
arch -x86_64 brew install php#7.4
Compile the extension
git clone https://github.com/FirebirdSQL/php-firebird.git
cd php-firebird
phpize
CFLAGS='-arch x86_64' CPPFLAGS=-I/Library/Frameworks/Firebird.framework/Headers LDFLAGS=-L/Library/Frameworks/Firebird.framework/Resources/lib ./configure
make
sudo make install
Tying it all together
I added the following to my php.ini file
extension=interbase
If you don't know where to edit your ini file, run the following command:
php -ini | grep php.ini
When I ran php -ini | grep interpose I got errors about not finding the firebird libraries. In the end I copied the libraries to the PHP bin and lib folders
cp /Library/Frameworks/Firebird.framework/Resources/lib/* /usr/local/Cellar/php#7.4/7.4.25/lib
cp /Library/Frameworks/Firebird.framework/Resources/lib/* /usr/local/Cellar/php#7.4/7.4.25/bin
I'm sure someone could comment on making the above a bit neater but I was happy to find that the ini command returns now as expected.
php -ini | grep interbase
interbase
Let me know if you hit issues I didn't find, there were some other things I tried for the Firebird library resolution but I'm not sure they worked.
Installing modules with PECL
As an addition the the above solution, easily install other PHP modules using the following command
arch -x86_64 pecl install <module>
Example
arch -x86_64 pecl install openswoole

Unable to build and install Valgrind on macOS High Sierra

I cannot install Valgrind on macOS High Sierra. It's not available through brew. I've tried with 3.10. After make install, I get this message:
configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x and 14.x (Mac OS X 10.6/7/8/9/10)
Homebrew says:
valgrind: This formula either does not compile or function as expected on macOS
versions newer than Sierra due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
I had the problem like this.
So, I found the solving. You should install valgrind by this code
brew install --HEAD valgrind
I have created a port of valgrind 3.13.0 to work on macOS High Sierra (10.13.x). You can get it here: https://github.com/padiakalpesh/valgrind_3.13_high_sierra
Once you have obtained the source, run the following commands from inside the source directory:
./configure
make
sudo make install
brew install Valgrind has some compatibility problem when installing on latest macOS but there is a workaround with this problem. You must be getting this error message when you try to install it using brew.
$brew install valgrind
valgrind: This formula either does not compile or function as expected on macOS
versions newer than High Sierra due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.
-------------------------------------------------------------------SOLUTION--------------------------------------------------------------
Step1: $brew edit valgrind
Step2: Find this line in the file ->(url "https://sourceware.org/git/valgrind.git")
Step3: Replace it with -> (url "git://sourceware.org/git/valgrind.git")
Step4: $brew update
Step5: $brew install --HEAD valgrind
And Done!
Let me know if it still doesn't work.
Thanks!!
I have got this working in July 2018, for reference:
https://gist.github.com/AlessandroMinali/d8316d6cc650c97027433644c2ff31ee
Edit ./configure
- 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*)
+ 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*|applellvm-9.*)
- 5879: 16.*)
+ 5879: 17.*)
Run
./autogen.sh
./configure
make
make install
Create file ~/.valgrind.supp
# false positive for any executable (it seems)
# macOS 10.12.6
# valgrind 3.13.0
{
libtrace initialization false positive
Memcheck:Param
msg->desc.port.name
fun:mach_msg_trap
fun:mach_msg
fun:task_set_special_port
fun:_os_trace_create_debug_control_port
fun:_libtrace_init
}
Create file ~/.valgrindrc
--suppressions=$HOME/.valgrind.supp
Troubleshooting
if can not read suppresion file copy and paste the contents of $HOME
if it complains about clang versions, bump the first edit up
if it complains about Darwin version, bump the second edit up
using the brew install --HEAD valgrind also worked for me, but be sure to know that it will take awhile to pull the HEAD version, and build/install.
However, no other changes were needed.
I build the git head version of Valgrind on macOS fairly regularly. If you have xcode installed then there isn't much more to it than following the instructions here.
I'll update with my build script later.
As an alternative, you might want to consider clang sanitizers. This can be enabled in xcode, or with the -fsanitize=X option (where X is address, undefined, thread, memory and a few others).
Valgrind is a rather touchy piece of software, and requires updates for each major release of macOS.
As of February 2018, there is no released version of Valgrind which supports macOS High Sierra (10.13). You will need to use a development version of Valgrind, or use alternate tools. (Apple's Instruments may have some of the functionality you are looking for.)
MacPorts version started working for me in Sep 2018!
The command, for completeness sake (completes very fast - apparently, prebuilt):
sudo port install valgrind-devel
Version:
$ valgrind --version
valgrind-3.14.0.GIT
The following worked for me using the latest Valgrind release 3.14.0 (9th October 2018) on macOS 10.13.6.
VERSION="3.14.0"
wget -O - http://www.valgrind.org/downloads/valgrind-"$VERSION".tar.bz2 | tar xjf -
cd valgrind-"$VERSION"
# use --prefix=/path/to if you want it installed somewhere in particular
./configure
make
# may need sudo
make install
# test all is working
valgrind ls -l
These instructions are taken from the README inside the Valgrind release tar ball.

Install / upgrade gradle on Mac OS X

How do I install/upgrade gradle for Mac?
As mentioned in this tutorial, it's as simple as:
To install
brew install gradle
To upgrade
brew upgrade gradle
(using Homebrew of course)
Also see (finally) updated docs.
Another alternative is to use sdkman. An advantage of sdkman over brew is that many versions of gradle are supported. (brew only supports the latest version and 2.14.) To install sdkman execute:
curl -s "https://get.sdkman.io" | bash
Then follow the instructions. Go here for more installation information. Once sdkman is installed use the command:
sdk install gradle
Or to install a specific version:
sdk install gradle 2.2
Or use to use a specific installed version:
sdk use gradle 2.2
To see which versions are installed and available:
sdk list gradle
For more information go here.
And using ports:
port install gradle
Ports , tested on El Capitan
I had downloaded it from http://gradle.org/gradle-download/. I use Homebrew, but I missed installing gradle using it.
To save some MBs by downloading it over again using Homebrew, I symlinked the gradle binary from the downloaded (and extracted) zip archive in the /usr/local/bin/. This is the same place where Homebrew symlinks all other binaries.
cd /usr/local/bin/
ln -s ~/Downloads/gradle-2.12/bin/gradle
Now check whether it works or not:
gradle -v
Two Method
using homebrew auto install:
Steps:
brew install gradle
Pros and cons
Pros: easy
Cons: (probably) not latest version
manually install (for latest version):
Pros and cons
Pros: use your expected any (or latest) version
Cons: need self to do it
Steps
download latest version binary (gradle-6.0.1) from Gradle | Releases
unzip it (gradle-6.0.1-all.zip) and added gradle path into environment variable PATH
normally is edit and add following config into your startup script( ~/.bashrc or ~/.zshrc etc.):
export GRADLE_HOME=/path_to_your_gradle/gradle-6.0.1
export PATH=$GRADLE_HOME/bin:$PATH
some other basic note
Q: How to make PATH take effect immediately?
A: use source:
source ~/.bashrc
it will make/execute your .bashrc, so make PATH become your expected latest values, which include your added gradle path.
Q: How to check PATH is really take effect/working now?
A: use echo to see your added path in indeed in your PATH
➜ ~ echo $PATH
xxx:/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin:xxx
you can see we added /Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin into your PATH
Q: How to verify gradle is installed correctly on my Mac ?
A: use which to make sure can find gradle
➜ ~ which gradle
/Users/crifan/dev/dev_tool/java/gradle/gradle-6.0.1/bin/gradle
AND to check and see gradle version
➜ ~ gradle --version
------------------------------------------------------------
Gradle 6.0.1
------------------------------------------------------------
Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5
Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_112 (Oracle Corporation 25.112-b16)
OS: Mac OS X 10.14.6 x86_64
this means the (latest) gradle is correctly installed on your mac ^_^.
for more detail please refer my (Chinese) post 【已解决】mac中安装maven

How To Update Boost When Yum Has the Outdated Version

I am trying to install the latest version of Gearman. However, it keeps giving me the error:
Checking for Boost Headers version >=
1.37... no
When I check my Boost version (yum list installed | grep boost), all the versions are 1.33. The latest Boost version is 1.46, but it seems CentOS does not have this version in their repositories.
Is there any way to get around yum to update Boost to the latest version?
You could try and build it from source or add a repo that has the latest boost distro to your yum repos.
Download and install earlier versions of Boost from this page: http://www.boost.org/users/history/
Or follow "Ben's" instructions here:
http://ben-tech.blogspot.com/2013/06/build-boost-for-impala-in-centos-63.html
What I did with this is to issue a
rpm -ql boost-devel and rpm -ql boost146-devel
mv /usr/include/boost146/boost /usr/include/boost`
cd /usr/lib/boost/
mv * /usr/lib/
Note: just replace the filenames if yours is different

Resources