Hiển thị các bài đăng có nhãn Ubuntu 64bits. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Ubuntu 64bits. Hiển thị tất cả bài đăng

Chủ Nhật, 2 tháng 3, 2014

HOW-TO: set up Java environment on Ubuntu.

Hi all,
I am kind of big moving from Windows to Ubuntu including infrastructures, softwares, and even cultures. However, I still use both Windows and Linux. I cannot live isolated with surrounding Windows machine around me in labs even my laptop. Windows are simple and convenient for normal users, but Ubuntu is just great for developers.
I definitely love Eclipse. In this blog, we provide some guide to start Java life in Ubuntu. C/C++ life in Ubuntu are great and simple. I supposed that Java life is also simple across different OSs.
First, you need to install Java Development Kit (JDK) which includes Java Runtime Environments (JRE). Going to Oracle and download the newest jdk1.7 [1]. For example, I downloaded jdk1.7.0_51. Then I untar it.
tar xzf jdk-7u51-linux-x64.gz
 As a admin user, you can add or change these two lines in your /etc/profile to point to the installation and it will affect system-wide. OR as a normal user, you can export an environment variable in ~ /.profile. Where JAVA_HOME is the place you just untar your jdk, for instance, /home/tranlaman/Downloads/jdk1.7.0_51.
export JAVA_HOME=/home/tranlaman/Downloads/jdk1.7.0_51
export PATH=$PATH:$JAVA_HOME/bin
 Then, you log out and in again to see effect of the environment variables. After that, you download and install Eclipse from [2].
Further, if you want to install C/C++ plugin in Eclipse to develop C/C++ programs, you can follow this instruction. Go to Help/Install New Softwares, then add the C/C++ Development Toolkit (CDT) link in the box as http://download.eclipse.org/tools/cdt/releases/kepler.
You can replace kepler as the version of Eclipse. Then press Enter.

[1] http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
[2] https://www.eclipse.org/downloads/


Thứ Sáu, 28 tháng 2, 2014

HOW-TO: build OpenCV 2.0 on Ubuntu 64 bits 12.04 LT

Hi all,
Sometimes, you want to build an old version of OpenCV on Ubuntu 64 bits. It seems not to be easy as I think. I met this error. That was suck.

../include/opencv/cxoperations.hpp:1916:15: error: ‘ptrdiff_t’ does not name a type
../include/opencv/cxoperations.hpp:2465:31: error: ‘ptrdiff_t’ does not name a type
The reason is that library might lack of a header file [1]. Just add "#include <cstddef>" to corresponding headers file that generates errors including cxoperations.hpp. And hope it will solve your problem.

Thứ Sáu, 14 tháng 6, 2013

HOW-TO: Install OpenCV-2.4.5 and ffmpeg-1.2.1 in Ubuntu 64bits

Bug       
      After spending several days to install the latest ffmpeg with the latest OpenCV, I discovered that I made a stupid mistakes. The follow is a big-bug that I had met during installing ffmpeg-1.2.1 which create shared library in order for OpenCV to recognize it.
'libavutil/intfloat_readwrite.o: relocation R_X86_64_PC32 against undefined symbol `ldexp@@GLIBC_2.2.5'. 
This error because of bad symbolic link in ubuntu. The reason is that I placed my install folder in shared folder between my computer and Virtualbox VMs [4]. Anyway, if you meet this error, please moving your folder to a safer place, not a shared folder. On the other hand, installing ffmpeg and opencv require you to to have --enable-shared option which create shared-library. So, you need to do the same to all other dependencies, --enable-shared option as in [3]. Other possible remedy, you might want to run ldconfig command to update run-time linker default [5]. The exact structure for this command is
ldconfig [your ffmpeg installer folder].
Installation         
      I am writing this post to summerize steps to install ffmpeg a common media cross-platform for OpenCV-2.4.5 to localize it. I recommend you to follow the instructions in  [3]. You can also follow [1] and
[2]. Refering to [2], you can test if you install OpenCV correctly (testing section). I copy and paste here for easy to refer.
Testing
An easy way to test that the compilation went well is to use the OpenCV test utilities. For example, to test the core module go to OpenCV-2.4.5/build/bin and run:
./opencv_test_core
 You should see something like this:

Note that some failures when testing other modules may come from missing image files. To correctly run these tests or samples you should move the corresponding image files from OpenCV-2.4.5/samples to OpenCV-2.4.5/build/bin.

For testing that you can compile your own programs and link against the installed OpenCV libraries I have packaged the face detection sample with all the necessary files and a simple Makefile. Download it here, extract and type:
make
This should compile and run with a test image, so you should see something like this: