Skip to content

Installing on POSIX

sean-dougherty edited this page Feb 10, 2015 · 3 revisions

This page contains cuda-edu installation for POSIX-like systems (e.g. Linux, Mac, and Cygwin). It assumes you have already followed instructions specific to your OS. If you haven't already, please see the page for your operating system.

The following instructions assume that you have a Terminal/Shell open and that you are in the directory under which you wish to install cuda-edu. If you're currently in the directory ~/, then these instructions will result in cuda-edu being installed within ~/cuda-edu.

Download the source

Warning! Students have encountered problems when trying to download the source as a zip. Please use the recommended git clone method that follows.

Issue the following command in your terminal:

git clone https://github.com/sean-dougherty/cuda-edu.git

The output should look similar to:

[laptop /tmp]$ git clone https://github.com/sean-dougherty/cuda-edu.git
Cloning into 'cuda-edu'...
remote: Counting objects: 801, done.        
remote: Compressing objects: 100% (66/66), done.        
remote: Total 801 (delta 22), reused 0 (delta 0)        
Receiving objects: 100% (801/801), 32.65 MiB | 2.30 MiB/s, done.
Resolving deltas: 100% (340/340), done.
Checking connectivity... done.

You should now have a cuda-edu directory. Move into it:

cd cuda-edu

Configure cuda-edu

Issue the following command in your terminal:

./configure

The output from this should look similar to the following:

Looking for c++ compiler...OK: /usr/bin/g++
Searching for libclang headers... OK: /usr/lib/llvm-3.4/include/clang-c/Index.h
Searching for libclang library... OK: /usr/lib/llvm-3.4/lib/libclang.so
generating Makefile.conf...OK
===
=== Configure completed successfully
===

If you encounter any kind of problems with the configure step, please inform me via cuda-edu@mail.com, regardless of whether you can resolve the problem on your own.

configure workaround

If the configure step fails, then you can manually configure. Create a Makefile.conf:

cp dev/etc/Makefile.conf.in Makefile.conf

Now edit the portion of Makefile.conf within the "INPUT PARAMETERS" block for your system by replacing the __configure...__ text with the appropriate values for your system.

Build cuda-edu

In your terminal, type:

make

You should see output similar to the following:

make -C dev/educc/ast
make[1]: Entering directory `/tmp/cuda-edu/dev/educc/ast'
/usr/bin/g++ main.cpp -o main -O2 -I/usr/lib/llvm-3.4/include /usr/lib/llvm-3.4/lib/libclang.so -std=c++11 -g -Wall -lrt -lpthread
mkdir -p ../../bin
cp main ../../bin/educc-ast
make[1]: Leaving directory `/tmp/cuda-edu/dev/educc/ast'
make -C dev/educc/cu2cpp
make[1]: Entering directory `/tmp/cuda-edu/dev/educc/cu2cpp'
/usr/bin/g++ main.cpp -o main -O2 -std=c++11 -g -Wall -lrt -lpthread
mkdir -p ../../bin
cp main ../../bin/educc-cu2cpp
make[1]: Leaving directory `/tmp/cuda-edu/dev/educc/cu2cpp'
===
=== Build completed successfully
===

Run Unit Tests

Now verify your installation is correct:

make tests

After this script runs, you should see a message like the following at the end:

===
=== Unit tests passed
===

If you see the message that the unit tests have passed, then you have a working installation. Yay! If the unit tests didn't pass, then please let me know: cuda-edu@mail.com.

Now you're ready to run the homework/mps. Please see the Running on POSIX page.