python -m pip install --user virtualenv
cd to install location path of env
python -m virtualenv env
source env/bin/activate
python -m pip install --user virtualenv
cd to install location path of env
python -m virtualenv env
source env/bin/activate
gflags
is not compiled as a shared library by default; make sure it is compiled as a shared library:
cd gflags/build
cmake .. -DBUILD_SHARED_LIBS=ON
make -j32
sudo make -j32 install
glog
compiles fine against gflags
.
import time
while True:
start_time = time.time() # start time of the loop
########################
# your fancy code here #
########################
print("FPS: ", 1.0 / (time.time() - start_time)) # FPS = 1 / time to process loop
import time
start_time = time.time()
x = 1 # displays the frame rate every 1 second
counter = 0
while True:
########################
# your fancy code here #
########################
counter+=1
if (time.time() - start_time) > x :
print("FPS: ", counter / (time.time() - start_time))
counter = 0
start_time = time.time()
$sudo apt-get install hardinfo
sudo apt-get install lshw
sudo lshw -short
H/W path Device Class Description
==================================================
system VirtualBox
/0 bus VirtualBox
/0/0 memory 128KiB BIOS
/0/1 memory 1999MiB System memory
/0/2 processor Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
/0/100 bridge 440FX - 82441FX PMC [Natoma]
/0/100/1 bridge 82371SB PIIX3 ISA [Natoma/Triton II]
/0/100/1.1 storage 82371AB/EB/MB PIIX4 IDE
/0/100/2 display VirtualBox Graphics Adapter
/0/100/3 eth0 network 82540EM Gigabit Ethernet Controller
/0/100/4 generic VirtualBox Guest Service
/0/100/5 multimedia 82801AA AC'97 Audio Controller
/0/100/7 bridge 82371AB/EB/MB PIIX4 ACPI
/0/100/8 eth1 network 82540EM Gigabit Ethernet Controller
/0/100/d storage 82801HM/HEM (ICH8M/ICH8M-E) SATA Controll
/0/3 scsi2 storage
/0/3/0.0.0 /dev/sda disk 68GB VBOX HARDDISK
/0/3/0.0.0/1 /dev/sda1 volume 487MiB Linux filesystem partition
/0/3/0.0.0/2 /dev/sda2 volume 63GiB Extended partition
/0/3/0.0.0/2/5 /dev/sda5 volume 63GiB Linux LVM Physical Volume partition
sudo lshw -html > server_specs.html
server_specs.html
file will then look something like:-c
argument:sudo lshw -C [component name]
sudo lshw -C network
*-network:0
description: Ethernet interface
product: 82540EM Gigabit Ethernet Controller
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:00:03.0
logical name: eth0
version: 02
serial: 08:00:27:e8:bf:1b
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt- fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversio n=7.3.21-k8-NAPI duplex=full ip=10.0.2.15 latency=64 link=yes mingnt=255 multica st=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:f0000000-f001ffff ioport:d010(size=8)
*-network:1
description: Ethernet interface
product: 82540EM Gigabit Ethernet Controller
vendor: Intel Corporation
physical id: 8
bus info: pci@0000:00:08.0
logical name: eth1
version: 02
serial: 08:00:27:69:a2:01
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt- fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversio n=7.3.21-k8-NAPI duplex=full ip=192.168.33.10 latency=64 link=yes mingnt=255 mul ticast=yes port=twisted pair speed=1Gbit/s
resources: irq:16 memory:f0820000-f083ffff ioport:d240(size=8)
sudo lshw -C volume
*-volume:0
description: Linux filesystem partition
vendor: Linux
physical id: 1
bus info: scsi@2:0.0.0,1
logical name: /dev/sda1
logical name: /boot
version: 1.0
serial: 9ff6ec2f-4052-4861-a546-f31e7a95c11b
size: 487MiB
capacity: 487MiB
capabilities: primary bootable extended_attributes large_files ext2 initialized
configuration: filesystem=ext2 lastmountpoint=/boot modified=2018-07-01 19:24:44 mount.fstype=ext2 mount.options=rw,relatime,block_validity,barrier,user_xattr,acl mounted=2018-07-01 19:24:44 state=mounted
*-volume:1
description: Extended partition
physical id: 2
bus info: scsi@2:0.0.0,2
logical name: /dev/sda2
size: 63GiB
capacity: 63GiB
capabilities: primary extended partitioned partitioned:extended
*-logicalvolume
description: Linux LVM Physical Volume partition
physical id: 5
logical name: /dev/sda5
serial: eSLg7t-nBsZ-fJT4-gDq4-s70Z-1Cg5-rIwDUX
size: 63GiB
capacity: 63GiB
capabilities: multi lvm2
sudo lshw -C processor
*-cpu
product: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
vendor: Intel Corp.
physical id: 2
bus info: cpu@0
width: 64 bits
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp x86-64 constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx rdrand hypervisor lahf_lm fsgsbase
sudo lshw -C sound
*-multimedia
description: Multimedia audio controller
product: 82801AA AC'97 Audio Controller
vendor: Intel Corporation
physical id: 5
bus info: pci@0000:00:05.0
version: 01
width: 32 bits
clock: 33MHz
capabilities: bus_master
configuration: driver=snd_intel8x0 latency=64
resources: irq:21 ioport:d100(size=256) ioport:d200(size=64)
sudo lshw -C memory
*-firmware
description: BIOS
vendor: innotek GmbH
physical id: 0
version: VirtualBox
date: 12/01/2006
size: 128KiB
capabilities: isa pci cdboot bootselect int9keyboard int10video acpi
*-memory
description: System memory
physical id: 1
size: 1999MiB
sudo apt install codeblocksHowever, Ubuntu repository only contains the outdated version (Code Blocks 16.01). To install the latest version, download the latest version.
wget http://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Linux/Debian%20stable/codeblocks_17.12-1_amd64_stable.tar.xz32 bit
wget http://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Linux/Debian%20stable/codeblocks_17.12-1_i386_stable.tar.xzExtract the tarball.
sudo tar xvf codeblocks_17.12-1_amd64_stable.tar.xz32 bit
sudo tar xvf codeblocks_17.12-1_i386_stable.tar.xzNow in the current directory, there are many Code Blocks deb packages. We need to run the following command to install Code Blocks.
sudo apt install ./codeblocks_17.12-1_amd64.deb ./codeblocks-common_17.12-1_all.deb ./libcodeblocks0_17.12-1_amd64.deb ./codeblocks-dev_17.12-1_amd64.deb ./codeblocks-headers_17.12-1_all.deb ./*wx*.deb32 bit
sudo apt install ./codeblocks_17.12-1_i386.deb ./codeblocks-common_17.12-1_all.deb ./libcodeblocks0_17.12-1_i386.deb ./codeblocks-dev_17.12-1_i386.deb ./codeblocks-headers_17.12-1_all.deb ./*wx*.debOnce installed, you can start Code Blocks IDE from Unity Dash or your preferred app launcher.
sudo apt install gccTo install the Clang compiler:
sudo apt install clangIf you want to compile native Windows binaries on Linux, then you can install the
mingw-w64
package.sudo apt install mingw-w64After choosing your default C compiler, you can start using Code Blocks to write programs.