Home » How to install CAL++ in Kali Linux?

How to install CAL++ in Kali Linux?

by blackMOREOps
81 comments

How to install CAL++ in Kali Linux - blackMORE Ops

This guide (How to install CAL++ in Kali Linux) is part of a series that guides readers on How to install FGLRX, AMD APP SDK, CAL++ and Pyrit in Kali Linux. The idea is to install correct drivers in Kali Linux for your GPU and use CPU+GPU combination with Pyrit to make raw data crunching faster. An example would be to utilize this combined processing power to crunch though WPA/WPA2 capture file to find Wifi password.

Readers, please follow this series in the following order:

  1. Install AMD ATI Driver (fglrx) in Kali Linux 1.x
  2. How to install AMD APP SDK in Kali Linux?
  3. How to install CAL++ in Kali Linux?
  4. How to install Pyrit in Kali Linux?

Credits:

A big thanks goes to hexed6 from Kali Forums for his original post.

Thanks to for his project in Sourceforge.

Check FGLRX Installation

First check if fglrx module is installed:

lsmod | grep fglrx

You should get a response similar to:

fglrx 2635205 82
button 12945 1 fglrx

If not installed follow this guide to install it.

Install AMD ATI Driver (fglrx) in Kali Linux 1.x

Check AMD APP SDK Installation

Check if AMD APP SDK is installed. If not installed follow this guide to install it.

How to install AMD APP SDK in Kali Linux?

Installing CAL++

CAL++ is a simple library to allow writing ATI CAL kernels directly in C++. The syntax is very similar to OpenCL. Also C++ wrapper for CAL is included.

This project was registered on SourceForge.net on Feb 19, 2010.

Install prerequisites:

apt-get install cmake libboost-all-dev

Download CAL++

Download calpp 0.90 from: SourceForge CAL++ Website

Install CAL++

tar -xvf calpp-0.90.tar.gz
cd calpp-0.90/

Edit CMakeLists.txt:

Find the lines starting with FIND_LIBRARY and FIND_PATH and replace them with this:

FIND_LIBRARY( LIB_ATICALCL aticalcl PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_LIBRARY( LIB_ATICALRT aticalrt PATHS "$ENV{ATISTREAMSDKROOT}" )
FIND_PATH( LIB_ATICAL_INCLUDE NAMES cal.h calcl.h PATHS "$ENV{ATISTREAMSDKROOT}/include/CAL" )

Save and quit,

Make and Install CAL++

Issue the following commands:

cmake .
make
make install

You may also like

81 comments

ChavezD July 23, 2014 - 2:18 am

Hey, had very bad problems with apt-get install cmake libboost-all-dev.
Always had some failure with Dependencies of other (libboost) Packages..
Tried everything, installing many things via Synaptic that had to deal with Libboost or tried downloading it from Boost.org.

What helped in the end:
In Synaptic, search for Libboost and uninstall EVERYTHING.. Afterwards:
sudo apt-get install -f
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
(dont know what exactly is necessary)
apt-get install cmake libboost-all-dev

Reply
DUmex July 26, 2014 - 4:15 am

— Boost version: 1.49.0
— Found the following Boost libraries:
— date_time
— ===========================================================
— ATI CAL include directory LIB_ATICAL_INCLUDE-NOTFOUND
— ATI CAL cl library directory /usr/lib/i386-linux-gnu
— ATI CAL rt library directory /usr/lib/i386-linux-gnu
— Boost version 1_49
— ===========================================================
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIB_ATICAL_INCLUDE
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/examples
used as include directory in directory /root/calpp-0.90/regression
used as include directory in directory /root/calpp-0.90/regression

Reply
anonx456 August 9, 2014 - 4:40 pm

Is there anyway that you know of to uninstall amdappsdk 2.9? and do you have the link to v 2.7?

Reply
test August 26, 2014 - 11:23 pm

download APP 2.9, uninstalled it and downloaded 2.7 redid all of that and now no matter what i do cmake . always returns empty vriables NOTFOUND
please advise

Reply
blackMORE Ops August 26, 2014 - 11:26 pm

2.9 breaks things badly. You could try to remove all files for 2.9 but I’m afraid you will waste time. Do a fresh install and start over.

Reply
test August 27, 2014 - 12:23 am

i have saved my /var/cache/apt , since i dont want to redownload everything, but how do i apply those deb packages after i populate the cache? the only way ive found so far is to go through each file one by one and sometimes it still finds an unmet dependancy

Reply
test August 26, 2014 - 11:48 pm

in any ubuntu flavored distros, what driver is shipped with OS? obviously it works as my HD 7970 is working out of the box, but not xorg.conf and when purging fglrx **** it says nothing intstalled, could this be the problem? how do i remove the stock drivers, ripping my hair out, ubuntu makes win 98 look like pure gold

Reply
test August 27, 2014 - 4:23 am

heres the magic baby!
of course change if diff paths

#FIND_LIBRARY( LIB_ATICALCL aticalcl PATHS “$ENV{ATISTREAMSDKROOT}/lib/” )
#FIND_LIBRARY( LIB_ATICALRT aticalrt PATHS “$ENV{ATISTREAMSDKROOT}/lib/” )
SET( LIB_ATICALCL “/opt/AMDAPP/lib/aticalcl” )
SET( LIB_ATICALRT “/opt/AMDAPP/lib/aticalrt” )
SET( LIB_ATICAL_INCLUDE “/opt/AMDAPP/include/CAL/” “/opt/AMDAPP/include/CAL/” )
#FIND_PATH( LIB_ATICAL_INCLUDE NAMES cal.h calcl.h PATHS “$ENV{ATISTREAMSDKROOT}/include/CAL/” )

result of sudo cmake . now ->
— Boost version: 1.54.0
— Found the following Boost libraries:
— date_time
— ===========================================================
— ATI CAL include directory /opt/AMDAPP/include/CAL/cal.h;/opt/AMDAPP/include/CAL/calcl.h
— ATI CAL cl library directory /opt/AMDAPP/lib
— ATI CAL rt library directory /opt/AMDAPP/lib
— Boost version 1_54
— ===========================================================
— Configuring done
— Generating done
— Build files have been written to: /home/tyler/Downloads/calpp-0.90

sudo make -> completes 100% with some warnings ->
/usr/bin/ld: skipping incompatible /opt/AMDAPP/lib/libaticalrt.so when searching for -laticalrt
/usr/bin/ld: skipping incompatible /opt/AMDAPP/lib/libaticalcl.so when searching for -laticalcl

sudo make install also completes no errors. badaboom badabing, hope this helps someone ;)

Reply
test August 27, 2014 - 4:25 am

can also fix boost date_time display by replacing boost 1.36.0 in CMakeList.txt to whatever boost version you have (my case 1.54.0)

test August 27, 2014 - 4:30 am

Computed 70958.10 PMKs/s total.
#1: ‘OpenCL-Device ‘Tahiti”: 77426.7 PMKs/s (RTT 2.2)
#2: ‘CPU-Core (SSE2)’: 621.8 PMKs/s (RTT 2.8)
#3: ‘CPU-Core (SSE2)’: 644.5 PMKs/s (RTT 2.9)
#4: ‘CPU-Core (SSE2)’: 646.0 PMKs/s (RTT 3.1)

=D

blackMORE Ops August 27, 2014 - 8:39 am

That’s a good benchmark. Congrats.

zzgero September 26, 2014 - 3:43 am

Hi there,

I can run the command cmake, but I can not run the last 2 commands:
make
make install

it said this errors:

root@kali:~/calpp-0.90# cmake
cmake version 2.8.9
Usage

cmake [options]
cmake [options]

Options
-C = Pre-load a script to populate the cache.
-D := = Create a cmake cache entry.
-U = Remove matching entries from CMake cache.
-G = Specify a makefile generator.
-Wno-dev = Suppress developer warnings.
-Wdev = Enable developer warnings.
-E = CMake command mode.
-i = Run in wizard mode.
-L[A][H] = List non-advanced cached variables.
–build = Build a CMake-generated project binary tree.
-N = View mode only.
-P = Process script mode.
–find-package = Run in pkg-config like mode.
–graphviz=[file] = Generate graphviz of dependencies.
–system-information [file] = Dump information about this system.
–debug-trycompile = Do not delete the try_compile build tree.
Only useful on one try_compile at a time.
–debug-output = Put cmake in a debug mode.
–trace = Put cmake in trace mode.
–warn-uninitialized = Warn about uninitialized values.
–warn-unused-vars = Warn about unused variables.
–no-warn-unused-cli = Don’t warn about command line options.
–check-system-vars = Find problems with variable usage in system
files.
–help-command cmd [file] = Print help for a single command and exit.
–help-command-list [file] = List available listfile commands and exit.
–help-commands [file] = Print help for all commands and exit.
–help-compatcommands [file]= Print help for compatibility commands.
–help-module module [file] = Print help for a single module and exit.
–help-module-list [file] = List available modules and exit.
–help-modules [file] = Print help for all modules and exit.
–help-custom-modules [file]= Print help for all custom modules and exit.
–help-policy cmp [file] = Print help for a single policy and exit.
–help-policies [file] = Print help for all policies and exit.
–help-property prop [file] = Print help for a single property and exit.
–help-property-list [file] = List available properties and exit.
–help-properties [file] = Print help for all properties and exit.
–help-variable var [file] = Print help for a single variable and exit.
–help-variable-list [file] = List documented variables and exit.
–help-variables [file] = Print help for all variables and exit.
–copyright [file] = Print the CMake copyright and exit.
–help,-help,-usage,-h,-H,/?= Print usage information and exit.
–help-full [file] = Print full help and exit.
–help-html [file] = Print full help in HTML format.
–help-man [file] = Print full help as a UNIX man page and exit.
–version,-version,/V [file]= Show program name/version banner and exit.

Generators

The following generators are available on this platform:
Ninja = Generates build.ninja files (experimental).
Unix Makefiles = Generates standard UNIX makefiles.
CodeBlocks – Ninja = Generates CodeBlocks project files.
CodeBlocks – Unix Makefiles = Generates CodeBlocks project files.
Eclipse CDT4 – Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 – Unix Makefiles
= Generates Eclipse CDT 4.0 project files.
KDevelop3 = Generates KDevelop 3 project files.
KDevelop3 – Unix Makefiles = Generates KDevelop 3 project files.

root@kali:~/calpp-0.90# make
make: *** No targets specified and no makefile found. Stop.

root@kali:~/calpp-0.90# make install
make: *** No rule to make target `install’. Stop.

Do somebody know what i am doing wrong?

Thanks

Regards

zzgero

Reply
help February 9, 2015 - 7:46 pm

You need to run cmake .
You forgot the space and the dot after cmake

Reply
Hulten October 28, 2014 - 4:43 am

After fixing my files like Porkash mentioned.

[ 6%] Building CXX object examples/CMakeFiles/coalescingtest.dir/coalescingtest.cpp.o
/root/calpp-0.90/examples/coalescingtest.cpp: In function ‘void show_result(int, int)’:
/root/calpp-0.90/examples/coalescingtest.cpp:224:5: error: reference to ‘int64_t’ is ambiguous
In file included from /usr/include/stdlib.h:314:0,
from /usr/include/c++/4.7/cstdlib:66,
from /usr/include/boost/config/platform/linux.hpp:15,
from /usr/include/boost/config.hpp:53,
from /usr/include/boost/detail/workaround.hpp:41,
from /usr/include/boost/format.hpp:19,
from /root/calpp-0.90/examples/coalescingtest.cpp:25:
/usr/include/x86_64-linux-gnu/sys/types.h:197:1: error: candidates are: typedef long int int64_t
In file included from /usr/include/boost/date_time/compiler_config.hpp:54:0,
from /usr/include/boost/date_time/posix_time/posix_time.hpp:14,
from /root/calpp-0.90/examples/coalescingtest.cpp:26:
/usr/include/boost/cstdint.hpp:308:50: error: typedef boost::long_long_type boost::int64_t
/root/calpp-0.90/examples/coalescingtest.cpp:224:13: error: expected ‘;’ before ‘bytes’
/root/calpp-0.90/examples/coalescingtest.cpp:225:29: error: ‘bytes’ was not declared in this scope
make[2]: *** [examples/CMakeFiles/coalescingtest.dir/coalescingtest.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/coalescingtest.dir/all] Error 2
make: *** [all] Error 2

I’m thinking I might have to try and redownload.

Reply
anon November 6, 2014 - 4:46 pm

I was having a problem with the “cmake .” command, with the error message:
“CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIB_ATICAL_INCLUDE”

The problem:
The system can’t find what you’re asking it to include/import.

How to solve it:
Make sure your environmental variables are correct
1. Open Terminal
2. Enter the command: “leafpad ~/.bashrc” If not leafpad, use any text editor (e.g. nano, vim)
3. Go to the bottom of the page and look for “ATISTREAMSDKROOT”
4. What is its value? If it looks like this: “$AMDAPPSDKROOT” It means that its trying to evaluate the variable called “AMDAPPSDKROOT”
5. Find the AMDAPPSDKROOT variable in the same file. What is its value? Mine looked like this: “/opt/AMDAPPSDK” which was wrong, because when I went to the folder of my system it was actually at “/opt/AMDAPPSDK-2.9-1”.

Make sure you have what you are importing
1. From the tutorial above, take note that it said “cal.h calcl.h” needs to be imported.
2. Procure these files from https://github.com/clockfort/amd-app-sdk-fixes/tree/master/include/CAL and place them in the correct folder, which the tutorial says is…

“$ENV{ATISTREAMSDKROOT}/include/CAL”
Which evaluates to
“/opt/AMDAPPSDK-2.9-1/include/CAL”
3. Proceed to do the “cmake .” command.

If you have missing files, return to the repository and place the necessary files in the correct folder. I had to put “cal_ext.h” file as well.

Reply
Zach handley January 19, 2015 - 4:39 am

I think you need to update this tutorial, as of now when I run cmake it does nothing but list to me potential commands after such as -i or -m etc.

Reply
Zach Handley January 25, 2015 - 7:38 am

Thought I’d post what I did here. First of all, Prokash’s Solution didn’t work for me. What I did was I checked the LIB_ATICAL part of it and found that it was pointing to /AMDAPP/Include when (and this is a serious I THINK) it should have been pointed to /AMDAPP/INCLUDE/CAL so I changed it and it worked. Just incase anyone needs this. (This was in the CMAKELists.txt)

Reply
archangel February 27, 2015 - 5:06 pm

Hi, for all having trouble installing CAL++ with the latest AMD 2.9.1 here is a link
https://forums.kali.org/showthread.php?22782-(Guide)-Fglrx-AMD-APP-SDK-Pyrit-Cal-for-AMD-Video-Cards

its basically same as blackmoreops way, except the path names. Another thing to note is that extract calpp-0.90 in the home directory (if logged in as root then /root directory) otherwise it does not work and give errors. Hope it helps someone :)

Reply
HAnz June 2, 2015 - 3:32 pm

I LOVE U MAN >…… < THKS

Reply
theFaruk July 22, 2015 - 3:47 pm

for those who are still having the problems same as Prokash

go to ur calpp-0.90 folder , read the README document , you will find this line:——>

Ensure that enviroment variable ATISTREAMSDKROOT points to ATI stream SDK directory.
Sometimes there is problem if directory in ATISTREAMSDKROOT doesn’t end with ‘\’

so complying to the above instructions

edit your .bashrc file like this (i mean add these lines)

AMD APP SDK

export AMDAPPSDKROOT=/opt/AMDAPPSDK-2.9-1/
export AMDAPPSDKSAMPLESROOT=/opt/AMDAPPSDK-2.9-1/
export LD_LIBRARY_PATH=${AMDAPPSDKROOT}lib/x86_64:${LD_LIBRARY_PATH}
export ATISTREAMSDKROOT=$AMDAPPSDKROOT

(in the 2nd line as you notice I added “/” in the end)

then delete your calpp-0.90 folder from /root or home folder and reboot

after that go to this page : https://forums.kali.org/showthread.php?22782-%28Guide%29-Fglrx-AMD-APP-SDK-Pyrit-Cal-for-AMD-Video-Cards

here if you have done step 11 earlier then continue to 12 otherwise do step 11 first

step 12 is very important if you didi it earlier and rebooted then continue otherwise do it and reboot now

then continue to step 21 and reboot……. DONE

THIS IS VERY ELABORATE!!!!!—-I KNOW U DIDN’T LIKE IT ; )

Great job blackMORE Ops

Reply
Sahand June 8, 2017 - 4:22 am

root@q-Z97X-Gaming-7:~/Downloads/calpp-0.90# cmake .
— The C compiler identification is GNU 5.4.0
— The CXX compiler identification is GNU 5.4.0
— Check for working C compiler: /usr/bin/cc
— Check for working C compiler: /usr/bin/cc — works
— Detecting C compiler ABI info
— Detecting C compiler ABI info – done
— Detecting C compile features
— Detecting C compile features – done
— Check for working CXX compiler: /usr/bin/c++
— Check for working CXX compiler: /usr/bin/c++ — works
— Detecting CXX compiler ABI info
— Detecting CXX compiler ABI info – done
— Detecting CXX compile features
— Detecting CXX compile features – done
— Boost version: 1.58.0
— Found the following Boost libraries:
— date_time
— ===========================================================
— ATI CAL include directory “/opt/AMDAPPSDK3.0/include/CAL/”;“/opt/AMDAPPSDK3.0/include/CAL/”
— ATI CAL cl library directory “/opt/AMDAPPSDK3.0/lib
— ATI CAL rt library directory “/opt/AMDAPPSDK3.0/lib
— Boost version 1_58
— ===========================================================
CMake Warning (dev) at CMakeLists.txt:34 (LINK_DIRECTORIES):
This command specifies the relative path

“/opt/AMDAPPSDK3.0/lib

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run “cmake –help-policy CMP0015” for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:34 (LINK_DIRECTORIES):
This command specifies the relative path

“/opt/AMDAPPSDK3.0/lib

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run “cmake –help-policy CMP0015” for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

— Configuring done
— Generating done
— Build files have been written to: /root/Downloads/calpp-0.90
root@q-Z97X-Gaming-7:~/Downloads/calpp-0.90# make
Scanning dependencies of target matrixmult3
[ 3%] Building CXX object examples/CMakeFiles/matrixmult3.dir/matrixmult3.cpp.o
In file included from /root/Downloads/calpp-0.90/examples/matrixmult3.cpp:32:0:
/root/Downloads/calpp-0.90/include/cal/cal.hpp:26:17: fatal error: cal.h: No such file or directory
compilation terminated.
examples/CMakeFiles/matrixmult3.dir/build.make:62: recipe for target ‘examples/CMakeFiles/matrixmult3.dir/matrixmult3.cpp.o’ failed
make[2]: *** [examples/CMakeFiles/matrixmult3.dir/matrixmult3.cpp.o] Error 1
CMakeFiles/Makefile2:101: recipe for target ‘examples/CMakeFiles/matrixmult3.dir/all’ failed
make[1]: *** [examples/CMakeFiles/matrixmult3.dir/all] Error 2
Makefile:127: recipe for target ‘all’ failed
make: *** [all] Error 2
root@q-Z97X-Gaming-7:~/Downloads/calpp-0.90#
what should i do?!!!

Reply
jack April 26, 2019 - 6:39 am

Does cal++ works with new macbook pro? Does it works with a professional egpu, for example Radeon Pro WX 9100? Can you make a post about this, with pyrit’s benchmark? thanks

Reply
1 2

Leave your solution or comment to help others. Comment don't need registration or real email, so feel free.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About Us

blackMORE Ops - touch-icon-72x72

blackMORE Ops” does not promote, encourages and excite hackers, its purpose is to make people aware that what is going around. Know Hacking but No Hacking!

Feature Posts

Newsletter