# Error in building from port



## htutt (Feb 11, 2014)

Hi,
I tried to install rkward-kde4 port as I could not install from pkg. But it failed with error code 2. It also said "Try to set MAKE_JOB_UNSAFE=yes". I also tried PSPP port before that. It said the same error of this. I don't know why and what should I do to get it right. Please help me.
You guys can see screenshot in attachment file.


----------



## SirDice (Feb 11, 2014)

Please post the entire error. The part where things actually go wrong isn't in the screenshot.


----------



## htutt (Feb 11, 2014)

Thank you for your reply. I'm not sure what I have to show you. Here is output from terminal.

```
[ 52%] Building CXX object rkward/rbackend/CMakeFiles/rkward.rbackend.dir/rktransmitter.o
[ 52%] Building CXX object rkward/plugin/CMakeFiles/plugin.dir/rkcomponentcontext.o
14 warnings generated.
[ 53%] Building CXX object rkward/dialogs/CMakeFiles/dialogs.dir/rkreadlinedialog.o
[ 54%] Generating scriptbackend.moc
[ 54%] Generating qtscriptbackend.moc
[ 55%] Generating rkcomponentscripting.moc
Linking CXX executable rkward.rbackend
[ 56%] Building CXX object rkward/plugin/CMakeFiles/plugin.dir/rkpreviewbox.o
[ 56%] Building CXX object rkward/dialogs/CMakeFiles/dialogs.dir/rkimportdialog.o
Scanning dependencies of target scriptbackends
CMakeFiles/rkward.rbackend.dir/rkstructuregetter.o: In function `RKStructureGetter::getStructureWorker(SEXPREC*, QString const&, int, RData*, int)':
/usr/ports/math/rkward-kde4/work/rkward-0.6.1/rkward/rbackend/rkstructuregetter.cpp:(.text+0x9ad): undefined reference to `R_data_class(SEXPREC*, Rboolean)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
--- rkward/rbackend/rkward.rbackend ---
*** [rkward/rbackend/rkward.rbackend] Error code 1

make[4]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
1 error

make[4]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
--- rkward/rbackend/CMakeFiles/rkward.rbackend.dir/all ---
*** [rkward/rbackend/CMakeFiles/rkward.rbackend.dir/all] Error code 2

make[3]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
--- rkward/scriptbackends/CMakeFiles/scriptbackends.dir/all ---
*** [rkward/scriptbackends/CMakeFiles/scriptbackends.dir/all] Error code 2

make[3]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
--- rkward/plugin/CMakeFiles/plugin.dir/all ---
*** [rkward/plugin/CMakeFiles/plugin.dir/all] Error code 2

make[3]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
In file included from /usr/ports/math/rkward-kde4/work/rkward-0.6.1/rkward/dialogs/rkimportdialog.cpp:18:
/usr/ports/math/rkward-kde4/work/rkward-0.6.1/rkward/dialogs/rkimportdialog.h:51:6: warning: private field 'format_count' is not used [-Wunused-private-field]
        int format_count;
            ^
1 warning generated.
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
--- rkward/dialogs/CMakeFiles/dialogs.dir/all ---
*** [rkward/dialogs/CMakeFiles/dialogs.dir/all] Error code 2

make[3]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
4 errors

make[3]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
--- all ---
*** [all] Error code 2

make[2]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
1 error

make[2]: stopped in /usr/ports/math/rkward-kde4/work/rkward-0.6.1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/math/rkward-kde4
*** Error code 1

Stop.
make: stopped in /usr/ports/math/rkward-kde4
[htutt@pcbsd] /usr/ports/math/rkward-kde4#
```


----------



## SirDice (Feb 11, 2014)

The real error appears to be this:

```
CMakeFiles/rkward.rbackend.dir/rkstructuregetter.o: In function `RKStructureGetter::getStructureWorker(SEXPREC*, QString const&, int, RData*, int)':
/usr/ports/math/rkward-kde4/work/rkward-0.6.1/rkward/rbackend/rkstructuregetter.cpp:(.text+0x9ad): undefined reference to `R_data_class(SEXPREC*, Rboolean)'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
```

Is your ports tree up to date? math/rkward-kde4 should have version 0.6.1_3. The last few patches seem to fix a bunch of errors.


----------



## htutt (Feb 11, 2014)

Today, I updated my ports via portsnap(8) and updated pkg from pkg-upgrade(8). Then I installed the ports. I will update and try it again. If it is showed error again, what I could do next? Have to wait for some fixes? Thank you, @SirDice.


----------



## SirDice (Feb 11, 2014)

After you made sure everything is up to date and it still fails to build properly you can send a problem report and/or email the port's maintainer.


----------



## htutt (Feb 11, 2014)

I will make that sure again. Thank you very much indeed for your reply. With regards!


----------



## chrbr (Feb 11, 2014)

Dear @htutt, dear @SirDice,
as I am a newcommer please forgive me a question regarding the procedure below.


			
				htutt said:
			
		

> Today, I updated my ports via portsnap(8) and updated pkg from pkg-upgrade(8). Then I installed the ports.


From my current understanding it is a mixture of packages and ports which work only if the releases of both repositories are similar. This is discouraged for beginners like myself. Have I overlooked any information which shows that this procedure will work?

The reason why I ask is that I would like to tune options of just a few ports only. Because of that I currently think I have to install everything from ports. I would like to learn to avoid the compile time for the other ports because my PC is not the fastest one. It is no big issue for myself but it is always nice to improve the own way of working.


----------



## SirDice (Feb 12, 2014)

It's possible to mix packages and ports but you have to keep a close eye on dependencies. A `pkg upgrade` or `pkg install` could potentially re-install a package reverting it to the default. So it's not something I would recommend doing.

If the machine is slow it may be worthwhile to set up your own repository. Building could be done at night when your not using the machine. It may take a while for everything to build but you don't have a half broken machine in the mean time. You can keep working as normal. Only when the repository is finished should you do a `pkg upgrade`. That should take a few minutes at most.


----------

