How to start CLion on FreeBSD?

CLion bundles a few native components built for Linux, these binaries won't work on FreeBSD. Noticeable examples are:

  • JRE (you need to install it in order to launch CLion),
  • fsnotifier (you will be warned on startup that file sync may be slow),
  • libpty (required for running apps with controlling TTY),
  • CMake,
  • and GDB.

So to start at FreeBSD you need to:

- Install the necessary components: pkg install openjdk8 cmake gdb
- Edit clion-2016.3/bin/idea.properties and change run.processes.with.pty=false
- Start CLion and open Settings | Build, Execution, Deployment | Toolchains
- Specify CMake path: /usr/local/bin/cmake and GDB path: /usr/local/bin/gdb

29 out of 36 found this helpful
7 comments

FreeBSD has replacement program for fsnotifier

pkg install intellij-fsnotifier

then edit bin/idea.properties

idea.filewatcher.executable.path=/usr/local/intellij/bin/fsnotifier

 

Edited by Leon Greeff
2

Audio eror

0

FYI: this is a better version of fsnotifier for FreeBSD.  The intellij fsnotifier port in the ports tree leaves a bunch of .fuse_hidden############## files in the directories it scans whenever you edit them (at least for a mounted NTFS drive via ntfs-3g,) leading to failed builds when you have directory modifications in CMakeLists.txt (e.g. deleting a build directory to make sure all the artifacts are fresh before a build) and makes it really difficult to navigate your project directory.  I know CLion can just filter files matching .fuse_hidden* if you set it to, but for me the CMake issues leading to failed builds were too painful not to seek an alternate solution.

Edited by Cory Geesaman
1

Your above tips were very helpful! If, however, someone encouters the error of CLion not being able to run the terminal you shall also do the following;

#`pkg install intellij-pty4j` as the libpty is needed by CLion

and then you may have to manually copy the library file to the path CLion is looking for it;

$mkdir -p /usr/home/$USER/Downloads/clion-x.x.x/lib/pty4j-native/freebsd/x86_64/

#cp /usr/local/intellij/lib/libpty/freebsd/x86_64/libpty.so /usr/home/$USER/Downloads/clion-x.x.x/lib/pty4j-native/freebsd/x86_64/ 

Hope this helps someone. I figured it out by looking at the error logs :)

1

There is now a FreeBSD pkg available `pkg install jetbrains-clion` should do all the necessary steps

Edited by Arved
2

For now from port tree i can install just 2020.2 version. Will be updates for port tree or for packages repository? And i can't to win code analyzer by clang. Will it be possible to setup external clangd, not clang-tidy only?

0

thank you for the port!

0

Please sign in to leave a comment.

Have more questions?

Submit a request