Solana Anchor Framework Installation Error: linking with 'cc' Failed - installation

I have beed facing problem to install solana anchor framework.
rust version rustc 1.65.0 (897e37553 2022-11-02)
cargo version cargo 1.65.0 (4bc8f24d3 2022-10-20)
if anybody know how to resolve this issue please reply
or tell me if i'm using a wrong version or wrong command
OS - Ubuntu 20.04
I have tried all the commands mentioned below but every command is throwing the same error.
cargo install --git https://github.com/project-serum/anchor avm --locked --force
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force

Related

Unable to install avm

I am using instructions from this site to install Anchor on my Windows laptop
https://book.anchor-lang.com/getting_started/installation.html#anchor
I have executed the command avm install latest and it gave this error:
Error: The system cannot find the file specified. (os error 2)
And the next command avm use latest returns this error:
Version 0.25.0 is not installed, no current version. Error: You need to run 'avm install 0.25.0' to install it before using it.
What should I do?
Try running the install command like this: cargo install --git https://github.com/project-serum/anchor --tag v0.26.0 anchor-cli --locked
I'm not 100% sure why this works, however, I was running into the same exact problem. If you specify the version via the --tag flag (v0.26.0 would be where you replace with the version you're interested in) and change the command from avm to anchor-cli it seems to work.

Getting this error message while installing solana: error: failed to run custom build command for `prost-build v0.10.1`

I'm got this error after running this command: ./scripts/cargo-install-all.sh .
error: failed to run custom build command for `prost-build v0.10.1`
I'm installing solana on m1 mac
Anyone please help me with this.
The prost-build crate compilation is failing because it can't find protocol-buffer implementation, and the crate build.rs tries to compile it via cmake (which you don't have installed).
I solved it by installing protocol-buffers directly, but since there are problems with the pre-compiled binary in M1 you have to compile it locally. It's simple:
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
brew install autoconf
brew install automake
brew install Libtool
autoreconf -i
./autogen.sh
./configure
make
make check
sudo make install
export PATH=/opt/usr/local/bin:$PATH
This works!!!

brew install OpenCV for macOS arm

i am using macOS arm, and install OpenCV for c++ using this command:
brew install --build-from-source OpenCV
download packages completed, and then i get this error:
==> Installing OpenCV
Error: An exception occurred within a child process:
RuntimeError: Unexpected architecture: arm64. This only works with Intel architecture.
can you help me?
This command should work as well.
brew install opencv
If this command shows any error you may share.
Clone sources
git clone https://github.com/opencv/opencv.git
Create build directory
mkdir -p build && cd build
Configure
cmake ../opencv
Build
cmake --build .

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.

Not able to compile/Build Lemon Graph library: Gives missing library

I am trying to build Lemon on my VM running ubuntu having gcc and g++ 4.9.2, but it keeps on giving the following error. I tried installing glpk, Soplex and ILOG Ciplex, but the error didn't go away. Following is the error.
Apparently, this issue is mentioned as fixed in lemon-1.3.1, but I am using the same and seems like it still persist.
Kindly let me know if anyone have an idea about how to solve this.
I had the same issue with the 1.3.1 tarball on a Linux Ubuntu 14.04 machine - cmake failed, because I had no GLPK, ILOG, COIN and SOPLEX installed.
But the development version from the repository doesn't complain:
hg clone http://lemon.cs.elte.hu/hg/lemon
If you prefer a version release, 1.3.0 from the repo builds for me too (1.3.1 doesn't):
hg clone http://lemon.cs.elte.hu/hg/lemon
hg checkout 1.3
Tested with the newest trunk:
mkdir build
cd build
cmake ..
make

Resources